Skip to content

Commit

Permalink
expose erasability of zipstore
Browse files Browse the repository at this point in the history
  • Loading branch information
Carreau committed Dec 3, 2020
1 parent 6c9999b commit 1991f8c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions zarr/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -1547,6 +1547,8 @@ class also supports the context manager protocol, which ensures the ``close()``
"""

_erasable = False

def __init__(self, path, compression=zipfile.ZIP_STORED, allowZip64=True, mode='a'):

# store properties
Expand Down
14 changes: 7 additions & 7 deletions zarr/tests/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,13 +400,13 @@ def test_hierarchy(self):
pass

# test rmdir (optional)
if hasattr(store, 'rmdir'):
store.rmdir('c/e')
assert 'c/d' in store
assert 'c/e/f' not in store
assert 'c/e/g' not in store
store.rmdir('c')
assert 'c/d' not in store
if store.is_erasable():
store.rmdir("c/e")
assert "c/d" in store
assert "c/e/f" not in store
assert "c/e/g" not in store
store.rmdir("c")
assert "c/d" not in store
store.rmdir()
assert 'a' not in store
assert 'b' not in store
Expand Down

0 comments on commit 1991f8c

Please sign in to comment.