Skip to content
This repository has been archived by the owner on Oct 14, 2020. It is now read-only.

Commit

Permalink
Check persons exactly. Don't care if WCA ID is missing.
Browse files Browse the repository at this point in the history
  • Loading branch information
jfly committed Apr 27, 2016
1 parent a9377f6 commit a842b4a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/compare_wca_json/compare_wca_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def test_ccm_matches_wa(self):
ccm_personId_to_canonicalId = {}
wa_persons = wa_json["persons"]
wa_personId_to_canonicalId = {}
self.assertEqual(len(ccm_persons), len(wa_persons))
canonicalId = 1
for wa_person in wa_json["persons"]:
for ccm_person in ccm_json["persons"]:
Expand All @@ -36,6 +35,17 @@ def test_ccm_matches_wa(self):
wa_personId_to_canonicalId[wa_person['id']] = canonicalId
canonicalId += 1
break
ccm_persons.sort(key=lambda p: ccm_personId_to_canonicalId[p['id']])
wa_persons.sort(key=lambda p: wa_personId_to_canonicalId[p['id']])
for p in ccm_persons:
del p['id']
if p.get('wcaId') == "":
del p['wcaId']
for p in wa_persons:
del p['id']
if p.get('wcaId') == "":
del p['wcaId']
self.assertEqual(ccm_persons, wa_persons)

# Check events
ccm_events = ccm_json["events"]
Expand Down

0 comments on commit a842b4a

Please sign in to comment.