Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Changes from all commits
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
30 changes: 30 additions & 0 deletions 30 tests/system/test_bucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,36 @@ def test_bucket_move_blob_hns(
assert source_gen != dest.generation


def test_bucket_move_blob_with_name_needs_encoding(
storage_client,
buckets_to_delete,
blobs_to_delete,
):
payload = b"move_blob_with_name_which_has_a_char_that_needs_url_encoding"

bucket_name = _helpers.unique_name("move-blob")
bucket_obj = storage_client.bucket(bucket_name)
created = _helpers.retry_429_503(storage_client.create_bucket)(bucket_obj)
buckets_to_delete.append(created)

source = created.blob("source")
source_gen = source.generation
source.upload_from_string(payload)
blobs_to_delete.append(source)

dest = created.move_blob(
source,
"dest/dest_file.txt",
if_source_generation_match=source.generation,
if_source_metageneration_match=source.metageneration,
)
blobs_to_delete.append(dest)

assert dest.download_as_bytes() == payload
assert dest.generation is not None
assert source_gen != dest.generation


def test_bucket_get_blob_with_user_project(
storage_client,
buckets_to_delete,
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.