Skip to content

Commit fcda233

Browse files
authored
chore: Add Sys test for move blob where name needs url encoding (#1624)
Sys test for move blob. Add System test for bukect.move_blob where blob name needs url encoding. The fix was done in #1605
1 parent 1c6b76f commit fcda233

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

tests/system/test_bucket.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,36 @@ def test_bucket_move_blob_hns(
472472
assert source_gen != dest.generation
473473

474474

475+
def test_bucket_move_blob_with_name_needs_encoding(
476+
storage_client,
477+
buckets_to_delete,
478+
blobs_to_delete,
479+
):
480+
payload = b"move_blob_with_name_which_has_a_char_that_needs_url_encoding"
481+
482+
bucket_name = _helpers.unique_name("move-blob")
483+
bucket_obj = storage_client.bucket(bucket_name)
484+
created = _helpers.retry_429_503(storage_client.create_bucket)(bucket_obj)
485+
buckets_to_delete.append(created)
486+
487+
source = created.blob("source")
488+
source_gen = source.generation
489+
source.upload_from_string(payload)
490+
blobs_to_delete.append(source)
491+
492+
dest = created.move_blob(
493+
source,
494+
"dest/dest_file.txt",
495+
if_source_generation_match=source.generation,
496+
if_source_metageneration_match=source.metageneration,
497+
)
498+
blobs_to_delete.append(dest)
499+
500+
assert dest.download_as_bytes() == payload
501+
assert dest.generation is not None
502+
assert source_gen != dest.generation
503+
504+
475505
def test_bucket_get_blob_with_user_project(
476506
storage_client,
477507
buckets_to_delete,

0 commit comments

Comments
 (0)