summary refs log tree commit diff
path: root/tests/storage
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2020-01-03 16:30:51 +0000
committerRichard van der Hoff <richard@matrix.org>2020-01-06 13:45:33 +0000
commitdc41fbf0dda981df117d8cf1938e023a38836cda (patch)
tree50a4f4841515468b2f25659a609c3b0a13deb313 /tests/storage
parentRemove unused hashes and depths from _update_membership params (diff)
downloadsynapse-dc41fbf0dda981df117d8cf1938e023a38836cda.tar.xz
Remove unused get_prev_events_and_hashes_for_room
Diffstat (limited to 'tests/storage')
-rw-r--r--tests/storage/test_event_federation.py19
1 files changed, 6 insertions, 13 deletions
diff --git a/tests/storage/test_event_federation.py b/tests/storage/test_event_federation.py
index 3a68bf3274..a331517f4d 100644
--- a/tests/storage/test_event_federation.py
+++ b/tests/storage/test_event_federation.py
@@ -26,7 +26,7 @@ class EventFederationWorkerStoreTestCase(tests.unittest.TestCase):
         self.store = hs.get_datastore()
 
     @defer.inlineCallbacks
-    def test_get_prev_events_and_hashes_for_room(self):
+    def test_get_prev_events_for_room(self):
         room_id = "@ROOM:local"
 
         # add a bunch of events and hashes to act as forward extremities
@@ -60,21 +60,14 @@ class EventFederationWorkerStoreTestCase(tests.unittest.TestCase):
                 (event_id, bytearray(b"ffff")),
             )
 
-        for i in range(0, 11):
+        for i in range(0, 20):
             yield self.store.db.runInteraction("insert", insert_event, i)
 
-        # this should get the last five and five others
-        r = yield self.store.get_prev_events_and_hashes_for_room(room_id)
+        # this should get the last ten
+        r = yield self.store.get_prev_events_for_room(room_id)
         self.assertEqual(10, len(r))
-        for i in range(0, 5):
-            el = r[i]
-            depth = el[2]
-            self.assertEqual(10 - i, depth)
-
-        for i in range(5, 5):
-            el = r[i]
-            depth = el[2]
-            self.assertLessEqual(5, depth)
+        for i in range(0, 10):
+            self.assertEqual("$event_%i:local" % (19 - i), r[i])
 
     @defer.inlineCallbacks
     def test_get_rooms_with_many_extremities(self):