File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -508,6 +508,34 @@ def test_fsspec_pickle_round_trip_aldfs(adls_fsspec_fileio: FsspecFileIO) -> Non
508508 _test_fsspec_pickle_round_trip (adls_fsspec_fileio , "abfss://tests/foo.txt" )
509509
510510
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-expires-at-ms.testaccount.dfs.core.windows.net" : "1757597218121" ,
517+ "adls.sas-token-expires-at-ms.testaccount" : "test-sas-token"
518+ }
519+
520+ with mock .patch ("adfls.AzureBlobFileSystem" ) as mock_adfls :
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_adfls .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+
511539@pytest .mark .gcs
512540def test_fsspec_new_input_file_gcs (fsspec_fileio_gcs : FsspecFileIO ) -> None :
513541 """Test creating a new input file from a fsspec file-io"""
You can’t perform that action at this time.
0 commit comments