Skip to content

Commit 76f1519

Browse files
committed
mocking api call in google symptoms
1 parent fd50d9d commit 76f1519

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

google_symptoms/delphi_google_symptoms/run.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def run_module(params):
6060
"_".join([metric, smoother, "search"])
6161
for metric, smoother in product(COMBINED_METRIC, SMOOTHERS)
6262
)
63-
Epidata.auth = ("epidata", params["api_credentials"])
63+
Epidata.auth = ("epidata", params["indicator"]["api_credentials"])
6464
# Fetch metadata to check how recent each signal is
6565
metadata = Epidata.covidcast_meta()
6666
# Filter to only those we currently want to produce, ignore any old or deprecated signals

google_symptoms/tests/conftest.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def run_as_module():
7373
makedirs("receiving")
7474

7575
with mock.patch("delphi_google_symptoms.pull.initialize_credentials",
76-
return_value=None) as mock_credentials:
77-
with mock.patch("pandas_gbq.read_gbq", side_effect=[
78-
state_data, county_data]) as mock_read_gbq:
76+
return_value=None) as mock_credentials, \
77+
mock.patch("pandas_gbq.read_gbq", side_effect=[state_data, county_data]) as mock_read_gbq, \
78+
mock.patch("delphi_google_symptoms.run.Epidata.covidcast_meta", return_value=None) as mock_covidcast_meta:
7979
delphi_google_symptoms.run.run_module(params)

0 commit comments

Comments
 (0)