diff options
author | Matt Lyon <matthewlyon18@gmail.com> | 2020-09-09 12:26:33 +0100 |
---|---|---|
committer | Matt Lyon <matthewlyon18@gmail.com> | 2020-09-09 12:26:33 +0100 |
commit | 4e2d04eca0147396092d2163bd8706fe497a8bf1 (patch) | |
tree | d401230004fba97c37abf71c93f4b3c9078f33b0 /tests/unit/test_constants.py | |
parent | 1ad2946a5ff0902c8a028b7caec67037b8e61ce3 (diff) | |
download | tpb-lite-4e2d04eca0147396092d2163bd8706fe497a8bf1.tar.gz tpb-lite-4e2d04eca0147396092d2163bd8706fe497a8bf1.tar.bz2 tpb-lite-4e2d04eca0147396092d2163bd8706fe497a8bf1.zip |
added tests, switched to lxml
Diffstat (limited to 'tests/unit/test_constants.py')
-rw-r--r-- | tests/unit/test_constants.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/unit/test_constants.py b/tests/unit/test_constants.py new file mode 100644 index 0000000..944abd8 --- /dev/null +++ b/tests/unit/test_constants.py @@ -0,0 +1,27 @@ +import io +import unittest +import contextlib + +from tpblite.models import constants + + +class ConstantsTestCase(unittest.TestCase): + + def test_categories(self): + self.assertEqual(constants.CATEGORIES.VIDEO.MOVIES, 201) + + def test_printOptions_one(self): + sobj = io.StringIO() + with contextlib.redirect_stdout(sobj): + constants.ORDERS.NAME.printOptions() + self.assertEqual(sobj.getvalue(), 'DES\nASC\n') + + def test_printOptions_two(self): + sobj = io.StringIO() + with contextlib.redirect_stdout(sobj): + constants.CATEGORIES.GAMES.printOptions() + self.assertEqual( + sobj.getvalue(), + 'ALL\nPC\nMAC\nPSX\nXBOX360\nWII\nHANDHELD\nIOS\nANDROID\nOTHER\n' + ) +
\ No newline at end of file |