Skip to content

Mock covidcast/meta requests.get call #1470

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 19, 2022
Merged

Mock covidcast/meta requests.get call #1470

merged 1 commit into from
Jan 19, 2022

Conversation

qx-teo
Copy link
Contributor

@qx-teo qx-teo commented Jan 19, 2022

Description

Added mock for requests.get function.
Made sure that signals that are inactive have the 'active' tag as False, which in turn affects whether it is a valid geo_signal combo.

Changelog

  • datafetcher.py

Fixes

Added mock for requests.get function.
Made sure that signals that are inactive have the 'active' tag as False, which in turn affects whether it is a valid geo_signal combo.
@qx-teo
Copy link
Contributor Author

qx-teo commented Jan 19, 2022

Do I need to cite code I take from stackexchange? Is there some kind of procedure for this?

@qx-teo qx-teo requested a review from nmdefries January 19, 2022 06:04
Copy link
Contributor

@nmdefries nmdefries left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

Comment on lines +24 to +25
# Solution from https://stackoverflow.com/questions/15753390/
#how-can-i-mock-requests-and-the-response
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, linking to where you found a solution is fine, especially if the approach is tricky or complex or non-standard in some way. You can also link to explanations of bugs for larger or more complex bugs.

@krivard krivard merged commit 6141756 into main Jan 19, 2022
@krivard krivard deleted the fix_covidcast_mock branch January 19, 2022 22:05
qx-teo added a commit that referenced this pull request Jan 20, 2022
#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.
@qx-teo qx-teo mentioned this pull request Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove network call from validator test of get_geo_signal_combos
3 participants