@@ -200,27 +200,32 @@ def test_transaction(ssh, root_path):
200
200
f .rm (root_path , recursive = True )
201
201
202
202
203
- def test_mkdir_create_parent (ssh ):
203
+ @pytest .mark .parametrize ("path" , ["/a/b/c" , "a/b/c" ])
204
+ def test_mkdir_create_parent (ssh , path ):
204
205
f = fsspec .get_filesystem_class ("sftp" )(** ssh )
205
206
206
207
with pytest .raises (FileNotFoundError ):
207
- f .mkdir ("/a/b/c" )
208
+ f .mkdir (path )
208
209
209
- f .mkdir ("/a/b/c" , create_parents = True )
210
- assert f .exists ("/a/b/c" )
210
+ f .mkdir (path , create_parents = True )
211
+ assert f .exists (path )
211
212
212
- with pytest .raises (FileExistsError , match = "/a/b/c" ):
213
- f .mkdir ("/a/b/c" )
213
+ with pytest .raises (FileExistsError , match = path ):
214
+ f .mkdir (path )
214
215
215
- f .rm ("/a/b/c" , recursive = True )
216
+ f .rm (path , recursive = True )
217
+ assert not f .exists (path )
216
218
217
219
218
- def test_makedirs_exist_ok (ssh ):
220
+ @pytest .mark .parametrize ("path" , ["/a/b/c" , "a/b/c" ])
221
+ def test_makedirs_exist_ok (ssh , path ):
219
222
f = fsspec .get_filesystem_class ("sftp" )(** ssh )
220
223
221
- f .makedirs ("/a/b/c" )
224
+ f .makedirs (path )
222
225
223
- with pytest .raises (FileExistsError , match = "/a/b/c" ):
224
- f .makedirs ("/a/b/c" , exist_ok = False )
226
+ with pytest .raises (FileExistsError , match = path ):
227
+ f .makedirs (path , exist_ok = False )
225
228
226
- f .makedirs ("/a/b/c" , exist_ok = True )
229
+ f .makedirs (path , exist_ok = True )
230
+ f .rm (path , recursive = True )
231
+ assert not f .exists (path )
0 commit comments