diff options
author | BonfaceKilz | 2020-07-17 02:47:31 +0300 |
---|---|---|
committer | BonfaceKilz | 2020-07-24 03:47:45 +0300 |
commit | 8e3756b8b8094c5d025da31c54c1d0d95a55b0dc (patch) | |
tree | b77ecf0cc954dea50fd460b9534acfa4e0b91abc /test | |
parent | ef62b2c146bb1c8960a3ee700c544d61519998b2 (diff) | |
download | genenetwork2-8e3756b8b8094c5d025da31c54c1d0d95a55b0dc.tar.gz |
Add basic unittests
Diffstat (limited to 'test')
-rw-r--r-- | test/unittest/__init__.py | 0 | ||||
-rw-r--r-- | test/unittest/base/__init__.py | 0 | ||||
-rw-r--r-- | test/unittest/base/test_general_object.py | 21 |
3 files changed, 21 insertions, 0 deletions
diff --git a/test/unittest/__init__.py b/test/unittest/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/test/unittest/__init__.py diff --git a/test/unittest/base/__init__.py b/test/unittest/base/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/test/unittest/base/__init__.py diff --git a/test/unittest/base/test_general_object.py b/test/unittest/base/test_general_object.py new file mode 100644 index 00000000..eaefdec9 --- /dev/null +++ b/test/unittest/base/test_general_object.py @@ -0,0 +1,21 @@ +import unittest + +from wqflask.base.GeneralObject import GeneralObject + + +class TestGeneralObjectTests(unittest.TestCase): + """ + Test the GeneralObject base class + """ + + def test_object_contents(self): + """Test whether base contents are stored properly""" + test_obj = GeneralObject("a", "b", "c") + self.assertEqual("abc", ''.join(test_obj.contents)) + + def test_object_dict(self): + """Test whether the base class is printed properly""" + test_obj = GeneralObject("a", name="test", value=1) + self.assertEqual(str(test_obj), "value = 1\nname = test\n") + self.assertEqual( + repr(test_obj), "value = 1\nname = test\ncontents = ['a']\n") |