summary refs log tree commit diff
path: root/tests/test_federation.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2019-12-10 17:01:37 +0000
committerRichard van der Hoff <richard@matrix.org>2019-12-11 14:39:26 +0000
commite77237b9350a7054657b1a641883a09c6b5d44f3 (patch)
tree3243d1f0368748ebc55950c96d217e2682d8265e /tests/test_federation.py
parentConvert federation backfill to async (diff)
downloadsynapse-e77237b9350a7054657b1a641883a09c6b5d44f3.tar.xz
convert to async: FederationHandler.on_receive_pdu
and associated functions:
 * on_receive_pdu
 * handle_queued_pdus
 * get_missing_events_for_pdu
Diffstat (limited to 'tests/test_federation.py')
-rw-r--r--tests/test_federation.py14
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