mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-19 11:34:15 -04:00
Dependency inject ApplicationServiceApi when creating ApplicationServicesHandler.
This commit is contained in:
parent
a3c6010718
commit
11e6b3d18b
3 changed files with 9 additions and 11 deletions
|
@ -29,13 +29,9 @@ class AppServiceHandlerTestCase(unittest.TestCase):
|
|||
self.mock_as_api = Mock()
|
||||
hs = Mock()
|
||||
hs.get_datastore = Mock(return_value=self.mock_store)
|
||||
self.handler = ApplicationServicesHandler(hs) # thing being tested
|
||||
|
||||
# FIXME Would be nice to DI this rather than monkey patch:(
|
||||
if not hasattr(self.handler, "appservice_api"):
|
||||
# someone probably updated the handler but not the tests. Fail fast.
|
||||
raise Exception("Test expected handler.appservice_api to exist.")
|
||||
self.handler.appservice_api = self.mock_as_api
|
||||
self.handler = ApplicationServicesHandler(
|
||||
hs, self.mock_as_api
|
||||
)
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def test_notify_interested_services(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue