(config)
| 914 | |
| 915 | |
| 916 | def _check_root_dir_contents(config): |
| 917 | fs = config['fs'] |
| 918 | pathfn = config['pathfn'] |
| 919 | |
| 920 | d = pathfn('directory/') |
| 921 | nd = pathfn('directory/nested/') |
| 922 | |
| 923 | fs.create_dir(nd) |
| 924 | with pytest.raises(pa.ArrowInvalid): |
| 925 | fs.delete_dir_contents("") |
| 926 | with pytest.raises(pa.ArrowInvalid): |
| 927 | fs.delete_dir_contents("/") |
| 928 | with pytest.raises(pa.ArrowInvalid): |
| 929 | fs.delete_dir_contents("//") |
| 930 | |
| 931 | fs.delete_dir_contents("", accept_root_dir=True) |
| 932 | fs.delete_dir_contents("/", accept_root_dir=True) |
| 933 | fs.delete_dir_contents("//", accept_root_dir=True) |
| 934 | |
| 935 | with pytest.raises(pa.ArrowIOError): |
| 936 | fs.delete_dir(d) |
| 937 | |
| 938 | |
| 939 | def test_delete_root_dir_contents(mockfs, py_mockfs): |
no test coverage detected