Skip to content

Commit 13238ff

Browse files
committed
add test to ensure that we can create a read-only copy of the store with auto_mkdir=False
1 parent cec89ff commit 13238ff

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/test_store/test_fsspec.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,3 +426,13 @@ async def test_delete_dir_wrapped_filesystem(tmp_path: Path) -> None:
426426
assert await store.exists("foo-bar/zarr.json")
427427
assert not await store.exists("foo/zarr.json")
428428
assert not await store.exists("foo/c/0")
429+
430+
431+
async def test_with_read_only_auto_mkdir(tmp_path: Path) -> None:
432+
"""
433+
Test that creating a read-only copy of a store backed by the local file system does not error
434+
if auto_mkdir is False.
435+
"""
436+
437+
store_w = FsspecStore.from_url(f"file://{tmp_path}", storage_options={"auto_mkdir": False})
438+
_ = store_w.with_read_only()

0 commit comments

Comments
 (0)