Skip to content

Commit

Permalink
Merge pull request #278 from matrix-org/babolivier/test_replication
Browse files Browse the repository at this point in the history
Compare the output to the input when testing replication, not the other way around
  • Loading branch information
babolivier authored Feb 26, 2020
2 parents 8994c47 + f99c9f1 commit d4c27a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/278.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Make replication tests more reliable.
6 changes: 5 additions & 1 deletion tests/test_replication.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,15 @@ def test_incoming_replication(self):
cur = self.sydent.db.cursor()
res = cur.execute("SELECT originId, sgAssoc FROM global_threepid_associations")

res_assocs = {}
for row in res.fetchall():
originId = row[0]
signed_assoc = json.loads(row[1])

self.assertDictEqual(signed_assoc, signed_assocs[originId])
res_assocs[originId] = signed_assoc

for assoc_id, signed_assoc in signed_assocs.items():
self.assertDictEqual(signed_assoc, res_assocs[assoc_id])

def test_outgoing_replication(self):
"""Make a fake peer and associations and make sure Sydent tries to push to it.
Expand Down

0 comments on commit d4c27a9

Please sign in to comment.