646012c26db9335f69216c5d8656090c4211f323,storage/cloud-client/bucket_lock_test.py,,bucket,#,40
Before Change
def bucket():
Creates a test bucket and deletes it upon completion.
client = storage.Client()
bucket_name = "bucket-lock-" + str(int(time.time()))
bucket = client.create_bucket(bucket_name)
yield bucket
bucket.delete(force=True)
After Change
Yields a bucket that is deleted after the test completes.
bucket = None
while bucket is None or bucket.exists():
bucket_name = "bucket-lock-{}".format(uuid.uuid4())
bucket = storage.Client().bucket(bucket_name)
bucket.create()
yield bucket
bucket.delete(force=True)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 646012c26db9335f69216c5d8656090c4211f323
Time: 2020-03-05
Author: crwilcox@google.com
File Name: storage/cloud-client/bucket_lock_test.py
Class Name:
Method Name: bucket
Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 6e45bc9291e6d06383da38ed3b2265d0d2cc8f5c
Time: 2020-04-27
Author: tmatsuo@google.com
File Name: iam/api-client/service_accounts_test.py
Class Name:
Method Name: test_service_accounts
Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 6c7f63e58534ff60c524324a1cf8628c838df772
Time: 2020-03-05
Author: crwilcox@google.com
File Name: storage/cloud-client/iam_test.py
Class Name:
Method Name: bucket