Skip to content
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

Merged
merged 1 commit into from
Aug 16, 2016
Merged

Add a warning when using mocking without cache. #261

merged 1 commit into from
Aug 16, 2016

Conversation

ternus
Copy link
Contributor

@ternus ternus commented Aug 9, 2016

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.

@googlebot
Copy link
Collaborator

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. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@googlebot googlebot added the cla: no This human has *not* signed the Contributor License Agreement. label Aug 9, 2016
@ternus
Copy link
Contributor Author

ternus commented Aug 9, 2016

Signed.

@googlebot
Copy link
Collaborator

CLAs look good, thanks!

@googlebot googlebot added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Aug 9, 2016
@@ -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.

@nathanielmanistaatgoogle
Copy link
Contributor

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
@ternus
Copy link
Contributor Author

ternus commented Aug 16, 2016

@nathanielmanistaatgoogle Squashed and reworded commit message. Does everything look OK?

@nathanielmanistaatgoogle
Copy link
Contributor

I'm satisfied. @jonparrott will also review and will merge.

Thank you for the contribution!

@theacodes
Copy link
Contributor

LGTM, thank you!

@theacodes theacodes merged commit e469a9f into googleapis:master Aug 16, 2016
@ternus ternus deleted the mocking-keyerror-warning branch August 16, 2016 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants