Skip to content

Commit

Permalink
Merge pull request #1477 from cmu-delphi/fix_datafetcher_mock
Browse files Browse the repository at this point in the history
Fix requests.get mock
  • Loading branch information
krivard committed Jan 20, 2022
2 parents 88476b1 + e8dac87 commit 6ef4968
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion _delphi_utils_python/tests/validator/test_datafetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ def __init__(self, json_data, status_code):

def json(self):
return self.json_data
if kwargs["params"] == {'signal':'chng:inactive'}:
if len(kwargs) == 0:
return MockResponse([{'source': 'chng', 'db_source': 'chng'},
{'source': 'covid-act-now', 'db_source': 'covid-act-now'}], 200)
elif kwargs["params"] == {'signal': 'chng:inactive'}:
return MockResponse([{"signals": [{"active": False}]}], 200)
else:
return MockResponse([{"signals": [{"active": True}]}], 200)
Expand Down

0 comments on commit 6ef4968

Please sign in to comment.