Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compare the output to the input when testing replication, not the other way around #278

Merged
merged 3 commits into from
Feb 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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