Skip to content

Working on storage snippets #2609

Closed
Closed

Description

@daspecster

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?

Activity

  1. dhermes commented on Oct 25, 2016

    @dhermes
    Contributor
    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.
  2. daspecster commented on Oct 25, 2016

    @daspecster
    ContributorAuthor

    "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?

  3. dhermes commented on Oct 25, 2016

    @dhermes
    Contributor

    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
  4. added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    on Apr 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the Cloud Storage API.priority: p2Moderately-important priority. Fix may not be included in next release.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions