diff --git a/simplecrud/__init__.py b/simplecrud/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/simplecrud/tests/__init__.py b/simplecrud/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/simplecrud/tests/test_settings.py b/simplecrud/tests/test_settings.py new file mode 100644 index 0000000..e02d76c --- /dev/null +++ b/simplecrud/tests/test_settings.py @@ -0,0 +1,20 @@ +import unittest + +from simplecrud.settings import CRUDConfig + + +class TestCRUDConfig(unittest.TestCase): + def test_singleton(self): + config1 = CRUDConfig() + config2 = CRUDConfig() + self.assertEqual(config1, config2) + + def test_set_sessionmaker(self): + config = CRUDConfig() + config.set_sessionmaker("test") + self.assertEqual(config.sessionmaker, "test") + + def test_get_sessionmaker(self): + config = CRUDConfig() + with self.assertRaises(ValueError): + config.sessionmaker