summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-02-03 10:38:14 +0000
committerErik Johnston <erik@matrix.org>2015-02-03 10:39:41 +0000
commite7ca813dd476c83497d4130ad8efa9424d86e921 (patch)
treece25a39f615e72e05230d3cca398a467ac8bb06b /tests
parentDon't bother requesting PDUs with bad signatures from the same server (diff)
downloadsynapse-e7ca813dd476c83497d4130ad8efa9424d86e921.tar.xz
Try to ensure we don't persist an event we have already persisted. In persist_event check if we already have the event, if so then update instead of replacing so that we don't cause a bump of the stream_ordering.
Diffstat (limited to 'tests')
-rw-r--r--tests/handlers/test_federation.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/handlers/test_federation.py b/tests/handlers/test_federation.py
index 44dbce6bea..4270481139 100644
--- a/tests/handlers/test_federation.py
+++ b/tests/handlers/test_federation.py
@@ -91,7 +91,10 @@ class FederationTestCase(unittest.TestCase):
         self.datastore.persist_event.return_value = defer.succeed(None)
         self.datastore.get_room.return_value = defer.succeed(True)
         self.auth.check_host_in_room.return_value = defer.succeed(True)
-        self.datastore.have_events.return_value = defer.succeed({})
+
+        def have_events(event_ids):
+            return defer.succeed({})
+        self.datastore.have_events.side_effect = have_events
 
         def annotate(ev, old_state=None):
             context = Mock()