-
Notifications
You must be signed in to change notification settings - Fork 0
docs(storage): add samples for file archive generation and cors config #2
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd watch for excessive line lengths and make capitalization consistent.
storage_delete_file_archived_generation.delete_file_archived_generation(test_blob.bucket.name, test_blob.name, | ||
test_blob.generation) | ||
out, _ = capsys.readouterr() | ||
assert "blob " + test_blob.name + " was deleted" in out | ||
assert test_blob.bucket.get_blob(test_blob.name, generation=test_blob.generation) is None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested format:
storage_delete_file_archived_generation.delete_file_archived_generation(
test_blob.bucket.name,
test_blob.name,
test_blob.generation
)
out, _ = capsys.readouterr()
assert "blob " + test_blob.name + " was deleted" in out
blob = test_blob.bucket.get_blob(
test_blob.name,
generation=test_blob.generation
)
assert blob is None
|
||
|
||
def test_change_file_storage_class(test_blob, capsys): | ||
blob = storage_change_file_storage_class.change_file_storage_class(test_blob.bucket.name, test_blob.name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another one:
blob = storage_change_file_storage_class.change_file_storage_class(
test_blob.bucket.name,
test_blob.name
)
etc.
) | ||
|
||
print( | ||
"Generation {} of the Blob {} in bucket {} copied to blob {} in bucket {}.".format( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either capitalize all Blob
or leave lowercase, but be consistent.
|
||
bucket = storage_client.get_bucket(bucket_name) | ||
bucket.delete_blob(blob_name, generation=generation) | ||
print("Generation {} of blob {} was deleted from ".format(generation, blob_name, bucket_name)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing last {}
in the format
syntax.
blobs = storage_client.list_blobs(bucket_name) | ||
|
||
for blob in blobs: | ||
print(blob.name + "," + str(blob.generation)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd keep using format
for consistency.
…n-docs-samples into storage_sample_docs_2
Added Samples For
Change default storage class
Change file storage class
CORS configuration
List file archived generation
Delete file archived generation
Copy file archived generation