summary refs log tree commit diff
path: root/tests/test_federation.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-12-09 13:53:21 +0000
committerGitHub <noreply@github.com>2019-12-09 13:53:21 +0000
commit30e9adf32f7db9aa44693876d33692bf4590d363 (patch)
tree9b83e1dc2eeefaafe8eca4e5b95cffdf8572b346 /tests/test_federation.py
parentMerge pull request #6493 from matrix-org/erikj/invite_state_config (diff)
parentFix comment (diff)
downloadsynapse-30e9adf32f7db9aa44693876d33692bf4590d363.tar.xz
Merge pull request #6487 from matrix-org/erikj/pass_in_db
Pass in Database object to data stores.
Diffstat (limited to 'tests/test_federation.py')
-rw-r--r--tests/test_federation.py16
1 files changed, 5 insertions, 11 deletions
diff --git a/tests/test_federation.py b/tests/test_federation.py
index 7d82b58466..ad165d7295 100644
--- a/tests/test_federation.py
+++ b/tests/test_federation.py
@@ -33,6 +33,8 @@ class MessageAcceptTests(unittest.TestCase):
         self.reactor.advance(0.1)
         self.room_id = self.successResultOf(room)["room_id"]
 
+        self.store = self.homeserver.get_datastore()
+
         # Figure out what the most recent event is
         most_recent = self.successResultOf(
             maybeDeferred(
@@ -77,10 +79,7 @@ class MessageAcceptTests(unittest.TestCase):
         # Make sure we actually joined the room
         self.assertEqual(
             self.successResultOf(
-                maybeDeferred(
-                    self.homeserver.get_datastore().get_latest_event_ids_in_room,
-                    self.room_id,
-                )
+                maybeDeferred(self.store.get_latest_event_ids_in_room, self.room_id)
             )[0],
             "$join:test.serv",
         )
@@ -100,10 +99,7 @@ class MessageAcceptTests(unittest.TestCase):
 
         # Figure out what the most recent event is
         most_recent = self.successResultOf(
-            maybeDeferred(
-                self.homeserver.get_datastore().get_latest_event_ids_in_room,
-                self.room_id,
-            )
+            maybeDeferred(self.store.get_latest_event_ids_in_room, self.room_id)
         )[0]
 
         # Now lie about an event
@@ -141,7 +137,5 @@ class MessageAcceptTests(unittest.TestCase):
         )
 
         # Make sure the invalid event isn't there
-        extrem = maybeDeferred(
-            self.homeserver.get_datastore().get_latest_event_ids_in_room, self.room_id
-        )
+        extrem = maybeDeferred(self.store.get_latest_event_ids_in_room, self.room_id)
         self.assertEqual(self.successResultOf(extrem)[0], "$join:test.serv")