mirror of
https://github.com/evennia/evennia.git
synced 2026-04-02 22:17:17 +02:00
Added an example unittest to test_utils_utils.py.
This commit is contained in:
parent
23efa02965
commit
42c0235d0d
2 changed files with 6 additions and 3 deletions
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue