diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2019-12-11 16:36:06 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-11 16:36:06 +0000 |
commit | 894d2addacf4e7b9119784863781c893adbf34ff (patch) | |
tree | 6b4d9b35cf57a9a60c29daf8d09c7976544a7acf /tests | |
parent | Merge pull request #6504 from matrix-org/erikj/account_validity_async_await (diff) | |
parent | changelog (diff) | |
download | synapse-894d2addacf4e7b9119784863781c893adbf34ff.tar.xz |
Merge pull request #6517 from matrix-org/rav/event_auth/13
Port some of FederationHandler to async/await
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_federation.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/test_federation.py b/tests/test_federation.py index ad165d7295..68684460c6 100644 --- a/tests/test_federation.py +++ b/tests/test_federation.py @@ -1,6 +1,6 @@ from mock import Mock -from twisted.internet.defer import maybeDeferred, succeed +from twisted.internet.defer import ensureDeferred, maybeDeferred, succeed from synapse.events import FrozenEvent from synapse.logging.context import LoggingContext @@ -70,8 +70,10 @@ class MessageAcceptTests(unittest.TestCase): ) # Send the join, it should return None (which is not an error) - d = self.handler.on_receive_pdu( - "test.serv", join_event, sent_to_us_directly=True + d = ensureDeferred( + self.handler.on_receive_pdu( + "test.serv", join_event, sent_to_us_directly=True + ) ) self.reactor.advance(1) self.assertEqual(self.successResultOf(d), None) @@ -119,8 +121,10 @@ class MessageAcceptTests(unittest.TestCase): ) with LoggingContext(request="lying_event"): - d = self.handler.on_receive_pdu( - "test.serv", lying_event, sent_to_us_directly=True + d = ensureDeferred( + self.handler.on_receive_pdu( + "test.serv", lying_event, sent_to_us_directly=True + ) ) # Step the reactor, so the database fetches come back |