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

Working on storage snippets #2609

Closed
daspecster opened this issue Oct 25, 2016 · 3 comments
Closed

Working on storage snippets #2609

daspecster opened this issue Oct 25, 2016 · 3 comments
Assignees
Labels
api: storage Issues related to the Cloud Storage API. priority: p2 Moderately-important priority. Fix may not be included in next release.

Comments

@daspecster
Copy link
Contributor

Reference: https://github.com/daspecster/google-cloud-python/blob/add-storage-snippets/docs/storage_snippets.py

A few questions I have...

  1. Should I make a PR to merge in at this point since we're not currently running snippets AFAICT?
  2. If we're running these as system tests(which makes sense to me), I'm not sure how to handle things like email addresses for users and other account information(example).
  3. If I should make mocks instead of hitting the service, it seems like that defeats the purpose unless I can inherit from the real class and just override the methods or some similar strategy?
@daspecster daspecster added the api: storage Issues related to the Cloud Storage API. label Oct 25, 2016
@dhermes
Copy link
Contributor

dhermes commented Oct 25, 2016

  1. Yes
  2. "If we're running these as system tests" --> then run them like the storage system tests. Does adding a "fake address" like 'me@example.org' work? If not, create a variable user_address outside the snippet and then just put acl.user(user_address).grant_read() inside the snippet.
  3. @tseaver Has more opinions on this than I do.

@daspecster
Copy link
Contributor Author

"If we're running these as system tests" --> then run them like the storage system tests. Does adding a "fake address" like 'me@example.org' work? If not, create a variable user_address outside the snippet and then just put acl.user(user_address).grant_read() inside the snippet.

I looked at the storage system tests and those didn't seem to test the ACL settings. The fake address didn't work as it's not a valid user when testing against live data.

Wouldn't making the user_address variable make the snippet less readable?

@dhermes
Copy link
Contributor

dhermes commented Oct 25, 2016

Wouldn't making the user_address variable make the snippet less readable?

I don't think so, but maybe. If you think it does, you could

  • modify the grant that was added after the snippet to make sure you use a valid email address
  • find a valid email address that is "public domain", e.g. cloud-logs@google.com

@lukesneeringer lukesneeringer added the priority: p2 Moderately-important priority. Fix may not be included in next release. label Apr 19, 2017
@dhermes dhermes closed this as completed May 5, 2017
parthea pushed a commit that referenced this issue Oct 21, 2023
…tform/python-docs-samples#2609)

* automl: add base model samples for automl ga

* Add tests for each file, provide a unique model for each python version for kokoro

* Fix version check

* Update tests and format

* Update deploy_model_test.py

* Update license headers, ensure double quotes is used everywhere, leave black formatting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. priority: p2 Moderately-important priority. Fix may not be included in next release.
Projects
None yet
Development

No branches or pull requests

4 participants