(fs, pathfn)
| 864 | |
| 865 | |
| 866 | def 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 | |
| 898 | def test_delete_dir_contents(fs, pathfn): |
nothing calls this directly
no test coverage detected