@@ -1440,6 +1440,38 @@ def test_put_file(storage, tmp_path):
14401440 assert f3 == f4
14411441
14421442
1443+ @pytest .mark .parametrize ("put_method" , ["put" , "put_file" ])
1444+ def test_put_methods_with_content_settings (storage , put_method , tmp_path ):
1445+ from azure .storage .blob import ContentSettings
1446+
1447+ fs = AzureBlobFileSystem (
1448+ account_name = storage .account_name , connection_string = CONN_STR
1449+ )
1450+
1451+ src = tmp_path / "sample"
1452+ src .write_bytes (b"data" )
1453+
1454+ content_settings = {"content_type" : "application/json" , "content_encoding" : "UTF-8" }
1455+
1456+ container = "putdir-with-kwargs"
1457+ fs .mkdir (container )
1458+ getattr (fs , put_method )(
1459+ str (src ),
1460+ f"{ container } /sample.json" ,
1461+ content_settings = ContentSettings (** content_settings ),
1462+ )
1463+
1464+ blob_info = fs .info (f"{ container } /sample.json" )
1465+ assert (
1466+ blob_info ["content_settings" ]["content_type" ]
1467+ == content_settings ["content_type" ]
1468+ )
1469+ assert (
1470+ blob_info ["content_settings" ]["content_encoding" ]
1471+ == content_settings ["content_encoding" ]
1472+ )
1473+
1474+
14431475def test_isdir (storage ):
14441476 fs = AzureBlobFileSystem (
14451477 account_name = storage .account_name , connection_string = CONN_STR
0 commit comments