Skip to content

Commit

Permalink
trying to make comparison log more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
cyroxx committed Jan 21, 2021
1 parent 91d3034 commit 6ed8dbb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ def get_clean_item(data):


def compare_schools(new_school, old_school):
print()
print(f"Comparing {new_school.get('id')}")
new_school = sort_dict(new_school)
old_school = sort_dict(old_school)

Expand All @@ -47,12 +45,16 @@ def main():
for school in data[:10]:
school_id = school.get('info').get('id')

print()
print('#'*10, f'Comparing {school_id}')

upstream_data = {}
try:
upstream_data = fetch_data(school_id)
upstream_data.pop('raw')
except HTTPError as e:
print(f"Could not fetch old data for school-id {school_id}: {e}")
print(f"WARN: Could not fetch old data for school-id {school_id}: {e}")
print()

compare_schools(school.get('info'), upstream_data)

Expand Down

0 comments on commit 6ed8dbb

Please sign in to comment.