Exemplo n.º 1
0
def test_blob():
    """Yields a blob that resets its acl after the test completes."""
    bucket = storage.Client().bucket(BUCKET)
    blob = bucket.blob('storage_acl_test_sigil')
    blob.upload_from_string('Hello, is it me you\'re looking for?')
    acl = google.cloud.storage.acl.ObjectACL(blob)
    acl.reload()
    yield blob
    acl.save()
Exemplo n.º 2
0
def test_blob(cloud_config):
    """Yields a blob that resets its acl after the test completes."""
    bucket = storage.Client().bucket(cloud_config.storage_bucket)
    blob = bucket.blob('storage_acl_test_sigil')
    blob.upload_from_string('Hello, is it me you\'re looking for?')
    acl = google.cloud.storage.acl.ObjectACL(blob)
    acl.reload()
    yield blob
    acl.save()
Exemplo n.º 3
0
def test_bucket(cloud_config):
    """Yields a bucket that resets its acl after the test completes."""
    bucket = storage.Client().bucket(cloud_config.storage_bucket)
    acl = google.cloud.storage.acl.BucketACL(bucket)
    object_default_acl = google.cloud.storage.acl.DefaultObjectACL(bucket)
    acl.reload()
    object_default_acl.reload()
    yield bucket
    acl.save()
    object_default_acl.save()
Exemplo n.º 4
0
def test_bucket():
    """Yields a bucket that resets its acl after the test completes."""
    bucket = storage.Client().bucket(BUCKET)
    acl = google.cloud.storage.acl.BucketACL(bucket)
    object_default_acl = google.cloud.storage.acl.DefaultObjectACL(bucket)
    acl.reload()
    object_default_acl.reload()
    yield bucket
    acl.save()
    object_default_acl.save()
Exemplo n.º 5
0
def test_blob():
    """Yields a blob that resets its acl after the test completes."""
    bucket = storage.Client().bucket(BUCKET)
    blob = bucket.blob('storage_acl_test_sigil')
    blob.upload_from_string('Hello, is it me you\'re looking for?')
    acl = google.cloud.storage.acl.ObjectACL(blob)
    acl.reload()  # bucket ops rate limited 1 update per second
    time.sleep(1)
    yield blob  # bucket ops rate limited 1 update per second
    time.sleep(1)
    acl.save()
Exemplo n.º 6
0
def test_bucket():
    """Yields a bucket that resets its acl after the test completes."""
    bucket = storage.Client().bucket(BUCKET)
    acl = google.cloud.storage.acl.BucketACL(bucket)
    object_default_acl = google.cloud.storage.acl.DefaultObjectACL(bucket)
    acl.reload()
    object_default_acl.reload()
    time.sleep(1)  # bucket ops rate limited 1 update per second
    yield bucket
    time.sleep(1)  # bucket ops rate limited 1 update per second
    acl.save()
    object_default_acl.save()
Exemplo n.º 7
0
def test_bucket():
    """Yields a bucket that resets its acl after the test completes."""
    bucket = storage.Client().bucket(BUCKET)
    acl = google.cloud.storage.acl.BucketACL(bucket)
    object_default_acl = google.cloud.storage.acl.DefaultObjectACL(bucket)
    acl.reload()
    object_default_acl.reload()
    time.sleep(1) # bucket ops rate limited 1 update per second
    yield bucket
    time.sleep(1) # bucket ops rate limited 1 update per second
    acl.save()
    object_default_acl.save()