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

Function _check_root_dir_contents

python/pyarrow/tests/test_fs.py:916–936  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

914
915
916def _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
939def test_delete_root_dir_contents(mockfs, py_mockfs):

Callers 1

Calls 4

pathfnFunction · 0.85
create_dirMethod · 0.45
delete_dir_contentsMethod · 0.45
delete_dirMethod · 0.45

Tested by

no test coverage detected