@@ -12,6 +12,7 @@ def setup
12
12
@account_name = ENV [ "AZURE_ACCOUNT_NAME" ]
13
13
@access_key = ENV [ "AZURE_ACCESS_KEY" ]
14
14
@container = ENV [ "AZURE_PRIVATE_CONTAINER" ]
15
+ @public_container = ENV [ "AZURE_PUBLIC_CONTAINER" ]
15
16
@principal_id = ENV [ "AZURE_PRINCIPAL_ID" ]
16
17
@host = ENV [ "STORAGE_BLOB_HOST" ]
17
18
@client = AzureBlob ::Client . new (
@@ -409,4 +410,26 @@ def test_get_blob_tags
409
410
410
411
assert_equal ( { "tag1" => "value 1" , "tag 2" => "value 2" } , tags )
411
412
end
413
+
414
+ def test_copy_between_containers
415
+ destination_client = AzureBlob ::Client . new (
416
+ account_name : @account_name ,
417
+ access_key : @access_key ,
418
+ container : @public_container ,
419
+ principal_id : @principal_id ,
420
+ host : @host ,
421
+ )
422
+ client . create_block_blob ( key , content )
423
+ assert_equal content , client . get_blob ( key )
424
+
425
+ destination_client . copy_blob ( key , key , source_client : client )
426
+
427
+
428
+ assert_equal content , destination_client . get_blob ( key )
429
+
430
+ begin
431
+ destination_client . delete_blob ( key )
432
+ rescue AzureBlob ::Http ::FileNotFoundError
433
+ end
434
+ end
412
435
end
0 commit comments