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
@pytest.fixture
def bucket():
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: 7
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: geekcomputers/Python
Commit Name: 370e9904b001798fb6795170ca30d99f623ae1ce
Time: 2020-11-01
Author: yk66478@gmail.com
File Name: addition.py
Class Name:
Method Name:
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