File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff 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+
475505def test_bucket_get_blob_with_user_project (
476506 storage_client ,
477507 buckets_to_delete ,
You can’t perform that action at this time.
0 commit comments