Skip to content

Add a warning when using mocking without cache. - #261

Merged
theacodes merged 1 commit into
googleapis:masterfrom
ternus:mocking-keyerror-warning
Aug 16, 2016
Merged

Add a warning when using mocking without cache.#261
theacodes merged 1 commit into
googleapis:masterfrom
ternus:mocking-keyerror-warning

Conversation

@ternus

@ternus ternus commented Aug 9, 2016

Copy link
Copy Markdown
Contributor

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
Copy Markdown

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

ternus commented Aug 9, 2016

Copy link
Copy Markdown
Contributor Author

Signed.

@googlebot

Copy link
Copy Markdown

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
Comment thread googleapiclient/discovery.py Outdated
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
Copy Markdown
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

ternus commented Aug 16, 2016

Copy link
Copy Markdown
Contributor Author

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

@nathanielmanistaatgoogle

Copy link
Copy Markdown
Contributor

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

Thank you for the contribution!

@theacodes

Copy link
Copy Markdown
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