diff options
author | Sean Quah <8349537+squahtx@users.noreply.github.com> | 2022-06-07 18:17:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-07 18:17:32 +0100 |
commit | 3c1c40d843575edba27c56ef82146cced09bcf8f (patch) | |
tree | a15d5ffa0d739f4bb75dabdf7f1bb3e4d6348eef /tests/federation | |
parent | Use dummy fallback engines if imports fail (#12979) (diff) | |
download | synapse-3c1c40d843575edba27c56ef82146cced09bcf8f.tar.xz |
Clean up the test code for client disconnections (#12929)
* Reword failure message about `await_result=False` * Use `reactor.advance()` instead of `reactor.pump()` * Raise `AssertionError`s ourselves * Un-instance method `_test_disconnect` * Replace `ThreadedMemoryReactorClock` with `MemoryReactorClock`
Diffstat (limited to 'tests/federation')
-rw-r--r-- | tests/federation/transport/server/test__base.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/federation/transport/server/test__base.py b/tests/federation/transport/server/test__base.py index e63885c1c9..d33e86db4c 100644 --- a/tests/federation/transport/server/test__base.py +++ b/tests/federation/transport/server/test__base.py @@ -24,7 +24,7 @@ from synapse.types import JsonDict from synapse.util.ratelimitutils import FederationRateLimiter from tests import unittest -from tests.http.server._base import EndpointCancellationTestHelperMixin +from tests.http.server._base import test_disconnect class CancellableFederationServlet(BaseFederationServlet): @@ -54,9 +54,7 @@ class CancellableFederationServlet(BaseFederationServlet): return HTTPStatus.OK, {"result": True} -class BaseFederationServletCancellationTests( - unittest.FederatingHomeserverTestCase, EndpointCancellationTestHelperMixin -): +class BaseFederationServletCancellationTests(unittest.FederatingHomeserverTestCase): """Tests for `BaseFederationServlet` cancellation.""" skip = "`BaseFederationServlet` does not support cancellation yet." @@ -86,7 +84,7 @@ class BaseFederationServletCancellationTests( # request won't be processed. self.pump() - self._test_disconnect( + test_disconnect( self.reactor, channel, expect_cancellation=True, @@ -106,7 +104,7 @@ class BaseFederationServletCancellationTests( # request won't be processed. self.pump() - self._test_disconnect( + test_disconnect( self.reactor, channel, expect_cancellation=False, |