Skip to content
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

fix: remove deprecated methods in samples and tests #1274

Merged
merged 2 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
update method
  • Loading branch information
cojenco committed May 15, 2024
commit f236d0c4c9b09cac32762580a1d3ab7072903a53
5 changes: 2 additions & 3 deletions samples/snippets/rpo_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@
@pytest.fixture
def dual_region_bucket():
"""Yields a dual region bucket that is deleted after the test completes."""
storage_client = storage.Client()
bucket = None
location = "NAM4"
while bucket is None or bucket.exists():
bucket_name = f"bucket-lock-{uuid.uuid4()}"
bucket = storage_client.bucket(bucket_name)
storage_client.create_bucket(bucket, location=location)
bucket = storage.Client().bucket(bucket_name)
bucket.create(location=location)
yield bucket
bucket.delete(force=True)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def create_bucket_turbo_replication(bucket_name):
bucket = storage_client.bucket(bucket_name)
bucket_location = "NAM4"
bucket.rpo = RPO_ASYNC_TURBO
storage_client.create_bucket(bucket, location=bucket_location)
bucket.create(location=bucket_location)

print(f"{bucket.name} created with the recovery point objective (RPO) set to {bucket.rpo} in {bucket.location}.")

Expand Down