Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Better handle mismatch cases
Browse files Browse the repository at this point in the history
  • Loading branch information
chadwhitacre committed Apr 28, 2016
1 parent 8d6178c commit 197440c
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions match-balanced.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,22 @@ def process_month(db, cid2mat, uid2cid, year, month):
rec2mat[rec['id']] = match

if match.route is not None:
assert match.ref == rec['id']
assert match.status is not None
ordered.pop()
print('all set!')
if match.ref is None and match.status is None:
print('missing ref and status!')
elif match.ref != rec['id'] and match.status != rec['status']:
print('mismatched ref and status!')
elif match.ref is None:
print('missing ref!')
elif match.ref != rec['id']:
print('mismatched ref!')
elif match.status is None:
print('missing status!')
elif match.status != rec['status']:
print('mismatched status!')

else:
ordered.pop()
print('all set!')
else:
print('yes')
else:
Expand Down

0 comments on commit 197440c

Please sign in to comment.