3
0
Fork 0

Add generic handler base class, tests, docs

This commit is contained in:
Lance Edgar 2023-11-25 16:28:37 -06:00
parent 27a90b2a87
commit d73ff274df
2 changed files with 29 additions and 0 deletions

View file

@ -188,3 +188,16 @@ class TestAppProvider(TestCase):
# but provider can supply the attr
self.app.providers['mytest'] = MagicMock(foo_value='bar')
self.assertEqual(self.app.foo_value, 'bar')
class TestGenericHandler(TestCase):
def setUp(self):
self.config = WuttaConfig(appname='wuttatest')
self.app = app.AppHandler(self.config)
self.config.app = self.app
def test_constructor(self):
handler = app.GenericHandler(self.config)
self.assertIs(handler.config, self.config)
self.assertIs(handler.app, self.app)