Skip to content

Commit 76e6f6d

Browse files
committed
Make hardcoded comparisons approximate to account fluctuations
1 parent 5c12898 commit 76e6f6d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

test_module.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,9 +671,10 @@ def test_download_mandates_csv(self):
671671
for agency, index in zip(agency_policy, [4-1,10-1, 19-1, 64-1]):
672672
agency_index = funder.index(agency)
673673
self.assertEqual(policy[agency_index], agency_policy[agency])
674-
self.assertEqual(percentage2020[agency_index], agency_2020[agency])
675674
# Check that the percentage values from CSV and on the page agree.
676675
self.assertEqual(percentageOverall[agency_index], agency_overall[index].text)
676+
# The percentage fluctuates, so we can't check the exact value.
677+
self.assertAlmostEquals(int(percentage2020[agency_index][:-1]), int(agency_2020[agency][:-1]), delta=2)
677678
finally:
678679
if os.path.exists(filename):
679680
os.remove(filename)

0 commit comments

Comments
 (0)