File tree 2 files changed +20
-1
lines changed
2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 6
6
- id : end-of-file-fixer
7
7
- id : trailing-whitespace
8
8
- repo : https://github.com/psf/black
9
- rev : 22.1 .0
9
+ rev : 22.3 .0
10
10
hooks :
11
11
- id : black
12
12
exclude : ^docs/
Original file line number Diff line number Diff line change @@ -2274,6 +2274,25 @@ def test_lsdir(s3):
2274
2274
assert d in s3 .ls (test_bucket_name )
2275
2275
2276
2276
2277
+ def test_rm_recursive_folder (s3 ):
2278
+ s3 .touch (test_bucket_name + "/sub/file" )
2279
+ s3 .rm (test_bucket_name + "/sub" , recursive = True )
2280
+ assert not s3 .exists (test_bucket_name + "/sub/file" )
2281
+ assert not s3 .exists (test_bucket_name + "/sub" )
2282
+
2283
+ s3 .touch (test_bucket_name + "/sub/file" )
2284
+ s3 .touch (test_bucket_name + "/sub/" ) # placeholder
2285
+ s3 .rm (test_bucket_name + "/sub" , recursive = True )
2286
+ assert not s3 .exists (test_bucket_name + "/sub/file" )
2287
+ assert not s3 .exists (test_bucket_name + "/sub" )
2288
+
2289
+ s3 .touch (test_bucket_name + "/sub/file" )
2290
+ s3 .rm (test_bucket_name , recursive = True )
2291
+ assert not s3 .exists (test_bucket_name + "/sub/file" )
2292
+ assert not s3 .exists (test_bucket_name + "/sub" )
2293
+ assert not s3 .exists (test_bucket_name )
2294
+
2295
+
2277
2296
def test_copy_file_without_etag (s3 , monkeypatch ):
2278
2297
2279
2298
s3 .touch (test_bucket_name + "/copy_tests/file" )
You can’t perform that action at this time.
0 commit comments