diff options
author | Erik Johnston <erik@matrix.org> | 2015-02-03 10:38:14 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-02-03 10:39:41 +0000 |
commit | e7ca813dd476c83497d4130ad8efa9424d86e921 (patch) | |
tree | ce25a39f615e72e05230d3cca398a467ac8bb06b /tests/handlers/test_federation.py | |
parent | Don't bother requesting PDUs with bad signatures from the same server (diff) | |
download | synapse-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 '')
-rw-r--r-- | tests/handlers/test_federation.py | 5 |
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() |