diff options
author | Richard van der Hoff <richard@matrix.org> | 2020-12-02 17:40:31 +0000 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2020-12-02 18:38:29 +0000 |
commit | c834f1d67a7feeaebc353d0170f99a618bf32b5b (patch) | |
tree | 02091b0f7bb55d0fb2b673fbfdbbc59481b6bea1 /tests/handlers | |
parent | Remove redundant mocking (diff) | |
download | synapse-c834f1d67a7feeaebc353d0170f99a618bf32b5b.tar.xz |
remove unused `resource_for_federation`
This is now only used in `test_typing`, so move it there.
Diffstat (limited to 'tests/handlers')
-rw-r--r-- | tests/handlers/test_typing.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/handlers/test_typing.py b/tests/handlers/test_typing.py index 36086ca836..294b71e8e2 100644 --- a/tests/handlers/test_typing.py +++ b/tests/handlers/test_typing.py @@ -21,12 +21,13 @@ from mock import ANY, Mock, call from twisted.internet import defer from synapse.api.errors import AuthError +from synapse.federation.transport import server as federation_server from synapse.types import UserID, create_requester +from synapse.util.ratelimitutils import FederationRateLimiter 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") @@ -52,6 +53,17 @@ def _make_edu_transaction_json(edu_type, content): return json.dumps(_expect_edu_transaction(edu_type, content)).encode("utf8") +def register_federation_servlets(hs, resource): + federation_server.register_servlets( + hs, + resource=resource, + authenticator=federation_server.Authenticator(hs), + ratelimiter=FederationRateLimiter( + hs.get_clock(), config=hs.config.rc_federation + ), + ) + + class TypingNotificationsTestCase(unittest.HomeserverTestCase): servlets = [register_federation_servlets] |