diff options
author | Richard van der Hoff <richard@matrix.org> | 2020-12-02 15:26:25 +0000 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2020-12-02 16:30:01 +0000 |
commit | 7ea85302f3ce59cdb38bceb1c2aeea2d690e2dbb (patch) | |
tree | 2636a3544e0ced69fcb04996a2eb3c8cbe4b21ef /tests/handlers | |
parent | Add `create_resource_dict` method to HomeserverTestCase (diff) | |
download | synapse-7ea85302f3ce59cdb38bceb1c2aeea2d690e2dbb.tar.xz |
fix up various test cases
A few test cases were relying on being able to mount non-client servlets on the test resource. it's better to give them their own Resources.
Diffstat (limited to 'tests/handlers')
-rw-r--r-- | tests/handlers/test_typing.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/handlers/test_typing.py b/tests/handlers/test_typing.py index abbdf2d524..9a085ccaf6 100644 --- a/tests/handlers/test_typing.py +++ b/tests/handlers/test_typing.py @@ -15,18 +15,20 @@ import json +from typing import Dict from mock import ANY, Mock, call from twisted.internet import defer +from twisted.web.resource import Resource from synapse.api.errors import AuthError +from synapse.federation.transport.server import TransportLayerServer from synapse.types import UserID, create_requester from tests import unittest from tests.test_utils import make_awaitable from tests.unittest import override_config -from tests.utils import register_federation_servlets # Some local users to test with U_APPLE = UserID.from_string("@apple:test") @@ -53,8 +55,6 @@ def _make_edu_transaction_json(edu_type, content): class TypingNotificationsTestCase(unittest.HomeserverTestCase): - servlets = [register_federation_servlets] - def make_homeserver(self, reactor, clock): # we mock out the keyring so as to skip the authentication check on the # federation API call. @@ -77,6 +77,11 @@ class TypingNotificationsTestCase(unittest.HomeserverTestCase): return hs + def create_resource_dict(self) -> Dict[str, Resource]: + d = super().create_resource_dict() + d["/_matrix/federation"] = TransportLayerServer(self.hs) + return d + def prepare(self, reactor, clock, hs): mock_notifier = hs.get_notifier() self.on_new_event = mock_notifier.on_new_event |