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! |
| 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.