Added an example unittest to test_utils_utils.py.

This commit is contained in:
Griatch 2014-05-03 23:51:08 +02:00
parent 23efa02965
commit 42c0235d0d
2 changed files with 6 additions and 3 deletions

View file

@ -1,9 +1,12 @@
# test with game/manage.py test
import unittest
from src.utils import utils
class TestIsIter(unittest.TestCase):
def test_is_iter(self):
# self.assertEqual(expected, is_iter(iterable))
assert True # TODO: implement your test here
self.assertEqual(True, utils.is_iter([1,2,3,4]))
self.assertEqual(False, utils.is_iter("This is not an iterable"))
class TestCrop(unittest.TestCase):
def test_crop(self):

View file

@ -256,7 +256,7 @@ class AttributeHandler(object):
"Holds default values"
def __init__(self):
self.value = default
self.strvalue = str(default)
self.strvalue = str(default) if default is not None else None
if self._cache is None or not _TYPECLASS_AGGRESSIVE_CACHE:
self._recache()