Skip to content

Commit e8dac87

Browse files
committed
Fix requests.get mock
#1470 mocked out requests.get call, but #1471 uses another requests.get call that did not get mocked properly. We check which call this is and provide the apporpriate mocked response.
1 parent 88476b1 commit e8dac87

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

_delphi_utils_python/tests/validator/test_datafetcher.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ def __init__(self, json_data, status_code):
3131

3232
def json(self):
3333
return self.json_data
34-
if kwargs["params"] == {'signal':'chng:inactive'}:
34+
if len(kwargs) == 0:
35+
return MockResponse([{'source': 'chng', 'db_source': 'chng'},
36+
{'source': 'covid-act-now', 'db_source': 'covid-act-now'}], 200)
37+
elif kwargs["params"] == {'signal': 'chng:inactive'}:
3538
return MockResponse([{"signals": [{"active": False}]}], 200)
3639
else:
3740
return MockResponse([{"signals": [{"active": True}]}], 200)

0 commit comments

Comments
 (0)