@@ -97,7 +97,7 @@ def test_push_dataset_dict_to_hub_private(self, temporary_repo):
9797 assert local_ds ["train" ].features == hub_ds ["train" ].features
9898
9999 # Ensure that there is a single file on the repository that has the correct name
100- files = sorted (list_repo_files (self ._api , ds_name , repo_type = "dataset" , token = self ._token ))
100+ files = sorted (list_repo_files (self ._api , ds_name , repo_type = "dataset" , use_auth_token = self ._token ))
101101 assert all (
102102 fnmatch .fnmatch (file , expected_file )
103103 for file , expected_file in zip (
@@ -119,7 +119,7 @@ def test_push_dataset_dict_to_hub(self, temporary_repo):
119119 assert local_ds ["train" ].features == hub_ds ["train" ].features
120120
121121 # Ensure that there is a single file on the repository that has the correct name
122- files = sorted (list_repo_files (self ._api , ds_name , repo_type = "dataset" , token = self ._token ))
122+ files = sorted (list_repo_files (self ._api , ds_name , repo_type = "dataset" , use_auth_token = self ._token ))
123123 assert all (
124124 fnmatch .fnmatch (file , expected_file )
125125 for file , expected_file in zip (
@@ -142,7 +142,7 @@ def test_push_dataset_dict_to_hub_multiple_files(self, temporary_repo):
142142 assert local_ds ["train" ].features == hub_ds ["train" ].features
143143
144144 # Ensure that there are two files on the repository that have the correct name
145- files = sorted (list_repo_files (self ._api , ds_name , repo_type = "dataset" , token = self ._token ))
145+ files = sorted (list_repo_files (self ._api , ds_name , repo_type = "dataset" , use_auth_token = self ._token ))
146146 assert all (
147147 fnmatch .fnmatch (file , expected_file )
148148 for file , expected_file in zip (
@@ -170,7 +170,7 @@ def test_push_dataset_dict_to_hub_multiple_files_with_max_shard_size(self, tempo
170170 assert local_ds ["train" ].features == hub_ds ["train" ].features
171171
172172 # Ensure that there are two files on the repository that have the correct name
173- files = sorted (list_repo_files (self ._api , ds_name , repo_type = "dataset" , token = self ._token ))
173+ files = sorted (list_repo_files (self ._api , ds_name , repo_type = "dataset" , use_auth_token = self ._token ))
174174 assert all (
175175 fnmatch .fnmatch (file , expected_file )
176176 for file , expected_file in zip (
@@ -214,7 +214,7 @@ def test_push_dataset_dict_to_hub_overwrite_files(self, temporary_repo):
214214 local_ds .push_to_hub (ds_name , token = self ._token , max_shard_size = 500 << 5 )
215215
216216 # Ensure that there are two files on the repository that have the correct name
217- files = sorted (list_repo_files (self ._api , ds_name , repo_type = "dataset" , token = self ._token ))
217+ files = sorted (list_repo_files (self ._api , ds_name , repo_type = "dataset" , use_auth_token = self ._token ))
218218
219219 assert all (
220220 fnmatch .fnmatch (file , expected_file )
@@ -261,7 +261,7 @@ def test_push_dataset_dict_to_hub_overwrite_files(self, temporary_repo):
261261 local_ds .push_to_hub (ds_name , token = self ._token )
262262
263263 # Ensure that there are two files on the repository that have the correct name
264- files = sorted (list_repo_files (self ._api , ds_name , repo_type = "dataset" , token = self ._token ))
264+ files = sorted (list_repo_files (self ._api , ds_name , repo_type = "dataset" , use_auth_token = self ._token ))
265265
266266 assert all (
267267 fnmatch .fnmatch (file , expected_file )
@@ -418,7 +418,7 @@ def test_push_dataset_to_hub_skip_identical_files(self, temporary_repo):
418418 mock_hf_api .reset_mock ()
419419
420420 # Remove a data file
421- files = self ._api . list_repo_files ( ds_name , repo_type = "dataset" , token = self ._token )
421+ files = list_repo_files ( self ._api , ds_name , repo_type = "dataset" , use_auth_token = self ._token )
422422 data_files = [f for f in files if f .startswith ("data/" )]
423423 assert len (data_files ) > 1
424424 self ._api .delete_file (data_files [0 ], repo_id = ds_name , repo_type = "dataset" , token = self ._token )
0 commit comments