fix: always use 'wutta' prefix for provider entry points
otherwise not all providers will be discoverable, for custom appname also add `appname` prop for GenericHandler, AppProvider
This commit is contained in:
parent
f6d0912c03
commit
b4d6cfb0ed
2 changed files with 37 additions and 9 deletions
|
@ -134,6 +134,7 @@ class TestAppProvider(TestCase):
|
|||
provider = app.AppProvider(self.config)
|
||||
self.assertIs(provider.config, self.config)
|
||||
self.assertIs(provider.app, self.app)
|
||||
self.assertEqual(provider.appname, 'wuttatest')
|
||||
|
||||
# but can pass app handler instead
|
||||
with warnings.catch_warnings():
|
||||
|
@ -155,7 +156,7 @@ class TestAppProvider(TestCase):
|
|||
|
||||
# sanity check, we get *instances* back from this
|
||||
providers = self.app.get_all_providers()
|
||||
load_entry_points.assert_called_once_with('wuttatest.providers')
|
||||
load_entry_points.assert_called_once_with('wutta.app.providers')
|
||||
self.assertEqual(len(providers), 1)
|
||||
self.assertIn('fake', providers)
|
||||
self.assertIsInstance(providers['fake'], FakeProvider)
|
||||
|
@ -212,3 +213,4 @@ class TestGenericHandler(TestCase):
|
|||
handler = app.GenericHandler(self.config)
|
||||
self.assertIs(handler.config, self.config)
|
||||
self.assertIs(handler.app, self.app)
|
||||
self.assertEqual(handler.appname, 'wuttatest')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue