-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add a warning when using mocking without cache. #261
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
Signed. |
CLAs look good, thanks! |
@@ -315,6 +315,15 @@ def build_from_document( | |||
|
|||
if isinstance(service, six.string_types): | |||
service = json.loads(service) | |||
|
|||
if not 'rootUrl' in service and (isinstance(http, HttpMock) or |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Sorry to have missed that on first review. Please also squash commits and follow these guidelines in your commit message. |
If HttpMock or HttpMockSequence is used in a test without the cache being filled first, a strange KeyError will be thrown. This happens on e.g. Travis CI. Unfortunately this behavior is used in the tests; this patch adds a warning for those unfortunate enough to encounter it. See also: #208
@nathanielmanistaatgoogle Squashed and reworded commit message. Does everything look OK? |
I'm satisfied. @jonparrott will also review and will merge. Thank you for the contribution! |
LGTM, thank you! |
See #208 .
If HttpMock or HttpMockSequence is used in a test without the cache
being filled first, a strange KeyError will be thrown. This happens
on e.g. Travis CI. Unfortunately this behavior is used in the tests;
this patch adds a warning for those unfortunate enough to encounter
it.