Skip to content

Commit 4513ced

Browse files
committed
Extra test for compat endpoint
1 parent 6e7190f commit 4513ced

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

integrations/server/test_covidcast_endpoints.py

+6
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ def test_compatibility(self):
115115
out = self._fetch("/", signal=first.signal_pair(), geo=first.geo_pair(), time="day:*", is_compatibility=True)
116116
self.assertEqual(out["epidata"], [row.as_api_compatibility_row_dict() for row in rows])
117117

118+
with self.subTest("same contents sans excluded columns"):
119+
compat = self._fetch("/", signal=first.signal_pair(), geo=first.geo_pair(), time="day:*", is_compatibility=True)
120+
regular = self._fetch("/", signal=first.signal_pair(), geo=first.geo_pair(), time="day:*")
121+
regular_sans_excluded = [{k: v for k, v in row.items() if k not in ["source", "geo_type", "time_type"]} for row in regular["epidata"]]
122+
self.assertEqual(compat["epidata"], regular_sans_excluded)
123+
118124
def test_compatibility_restricted_source(self):
119125
"""Restricted request at the /api.php endpoint."""
120126
rows = [CovidcastTestRow.make_default_row(time_value=2020_04_01 + i, value=i, source="quidel") for i in range(10)]

0 commit comments

Comments
 (0)