Skip to content

Commit b5d8c9f

Browse files
author
Martin Durant
committed
more coverage
1 parent f5809a5 commit b5d8c9f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

zarr/creation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def normalize_store_arg(store, clobber=False, default=dict, storage_options=None
133133
elif isinstance(store, str):
134134
mode = 'w' if clobber else 'r'
135135
if "://" in store or "::" in store:
136-
return FSStore(store, **(storage_options or {}))
136+
return FSStore(store, mode=mode, **(storage_options or {}))
137137
elif storage_options:
138138
raise ValueError("storage_options passed with non-fsspec path")
139139
if store.endswith('.zip'):

zarr/tests/test_storage.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,12 @@ def test_consolidated(self):
871871
store2[".zarray"] = b"{{}}"
872872
with pytest.raises(PermissionError):
873873
del store2[".zarray"]
874+
with pytest.raises(PermissionError):
875+
store2.clear()
876+
with pytest.raises(PermissionError):
877+
store2.rmdir("any")
878+
with pytest.raises(ValueError):
879+
FSStore(os.path.join(path, ".zmetadata"))
874880

875881
store.clear()
876882
assert ".zmetadata" not in store
@@ -882,6 +888,7 @@ def test_not_fsspec(self):
882888
zarr.open_array(path, mode='w', storage_options={"some": "kwargs"})
883889
with pytest.raises(ValueError, match="storage_options"):
884890
zarr.open_group(path, mode='w', storage_options={"some": "kwargs"})
891+
zarr.open_array("file://" + path, mode='w', shape=(1,), dtype="f8")
885892

886893

887894
class TestNestedDirectoryStore(TestDirectoryStore, unittest.TestCase):

0 commit comments

Comments
 (0)