MCPcopy Create free account
hub / github.com/apache/arrow / test_delete_dir_with_explicit_subdir

Function test_delete_dir_with_explicit_subdir

python/pyarrow/tests/test_fs.py:866–895  ·  view source on GitHub ↗
(fs, pathfn)

Source from the content-addressed store, hash-verified

864
865
866def test_delete_dir_with_explicit_subdir(fs, pathfn):
867 # GH-38618: regression with AWS failing to delete directories,
868 # depending on whether they were created explicitly. Note that
869 # Minio doesn't reproduce the issue, so this test is not a regression
870 # test in itself.
871 skip_fsspec_s3fs(fs)
872
873 d = pathfn('directory/')
874 nd = pathfn('directory/nested/')
875
876 # deleting dir with explicit subdir
877 fs.create_dir(d)
878 fs.create_dir(nd)
879 fs.delete_dir(d)
880 dir_info = fs.get_file_info(d)
881 assert dir_info.type == FileType.NotFound
882
883 # deleting dir with blob in explicit subdir
884 d = pathfn('directory2')
885 nd = pathfn('directory2/nested')
886 f = pathfn('directory2/nested/target-file')
887
888 fs.create_dir(d)
889 fs.create_dir(nd)
890 with fs.open_output_stream(f) as s:
891 s.write(b'data')
892
893 fs.delete_dir(d)
894 dir_info = fs.get_file_info(d)
895 assert dir_info.type == FileType.NotFound
896
897
898def test_delete_dir_contents(fs, pathfn):

Callers

nothing calls this directly

Calls 7

skip_fsspec_s3fsFunction · 0.85
pathfnFunction · 0.85
create_dirMethod · 0.45
delete_dirMethod · 0.45
get_file_infoMethod · 0.45
open_output_streamMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected