Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kaziamov committed Dec 9, 2023
1 parent 55876ed commit 75878af
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
Empty file added simplecrud/__init__.py
Empty file.
Empty file added simplecrud/tests/__init__.py
Empty file.
20 changes: 20 additions & 0 deletions simplecrud/tests/test_settings.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 75878af

Please sign in to comment.