@@ -398,8 +398,31 @@ async def test_client_get_public_url(
398
398
assert response .content == file .file_content
399
399
400
400
401
+ async def test_client_upload_with_custom_metadata (
402
+ storage_file_client_public : AsyncBucketProxy , file : FileForTesting
403
+ ) -> None :
404
+ """Ensure we can get the public url of a file in a bucket"""
405
+ await storage_file_client_public .upload (
406
+ file .bucket_path ,
407
+ file .local_path ,
408
+ {
409
+ "content-type" : file .mime_type ,
410
+ "metadata" : {"custom" : "metadata" , "second" : "second" , "third" : "third" },
411
+ },
412
+ )
413
+
414
+ info = await storage_file_client_public .info (file .bucket_path )
415
+ assert "metadata" in info .keys ()
416
+ assert info ["name" ] == file .bucket_path
417
+ assert info ["metadata" ] == {
418
+ "custom" : "metadata" ,
419
+ "second" : "second" ,
420
+ "third" : "third" ,
421
+ }
422
+
423
+
401
424
async def test_client_info (
402
- storage_file_client_public : SyncBucketProxy , file : FileForTesting
425
+ storage_file_client_public : AsyncBucketProxy , file : FileForTesting
403
426
) -> None :
404
427
"""Ensure we can get the public url of a file in a bucket"""
405
428
await storage_file_client_public .upload (
@@ -413,7 +436,7 @@ async def test_client_info(
413
436
414
437
415
438
async def test_client_exists (
416
- storage_file_client_public : SyncBucketProxy , file : FileForTesting
439
+ storage_file_client_public : AsyncBucketProxy , file : FileForTesting
417
440
) -> None :
418
441
"""Ensure we can get the public url of a file in a bucket"""
419
442
await storage_file_client_public .upload (
0 commit comments