From e8dac87aa323bb94d13409bd641287fd397ea2ec Mon Sep 17 00:00:00 2001 From: QX Teo <37101453+qx-teo@users.noreply.github.com> Date: Thu, 20 Jan 2022 01:11:39 -0500 Subject: [PATCH] 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. --- _delphi_utils_python/tests/validator/test_datafetcher.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/_delphi_utils_python/tests/validator/test_datafetcher.py b/_delphi_utils_python/tests/validator/test_datafetcher.py index 8f75bd6ea..6016df3a2 100644 --- a/_delphi_utils_python/tests/validator/test_datafetcher.py +++ b/_delphi_utils_python/tests/validator/test_datafetcher.py @@ -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)