@@ -508,6 +508,34 @@ def test_fsspec_pickle_round_trip_aldfs(adls_fsspec_fileio: FsspecFileIO) -> Non
508
508
_test_fsspec_pickle_round_trip (adls_fsspec_fileio , "abfss://tests/foo.txt" )
509
509
510
510
511
+ @pytest .mark .adls
512
+ def test_adls_account_name_sas_token_extraction () -> None :
513
+ session_properties : Properties = {
514
+ "adls.tenant-id" : "test-tenant-id" ,
515
+ "adls.account-host" : "testaccount.dfs.core.windows.net" ,
516
+ "adls.sas-token.testaccount.dfs.core.windows.net" : "test-sas-token" ,
517
+ "adls.sas-token-expires-at-ms.testaccount.dfs.core.windows.net" : "1757597218121" ,
518
+ }
519
+
520
+ with mock .patch ("adlfs.AzureBlobFileSystem" ) as mock_adlfs :
521
+ adls_fileio = FsspecFileIO (properties = session_properties )
522
+ filename = str (uuid .uuid4 ())
523
+
524
+ adls_fileio .new_input (location = f"abfss://tests/{ filename } " )
525
+
526
+ mock_adlfs .assert_called_with (
527
+ connection_string = None ,
528
+ credential = None ,
529
+ account_name = "testaccount" ,
530
+ account_key = None ,
531
+ sas_token = "test-sas-token" ,
532
+ tenant_id = "test-tenant-id" ,
533
+ client_id = None ,
534
+ client_secret = None ,
535
+ account_host = "testaccount.dfs.core.windows.net" ,
536
+ )
537
+
538
+
511
539
@pytest .mark .gcs
512
540
def test_fsspec_new_input_file_gcs (fsspec_fileio_gcs : FsspecFileIO ) -> None :
513
541
"""Test creating a new input file from a fsspec file-io"""
0 commit comments