Skip to content

Commit

Permalink
Adapt storage tests for changes in fsspec (zarr-developers#1819) (zar…
Browse files Browse the repository at this point in the history
…r-developers#1679)

This is adapted from the fixes that were rolled into
zarr-developers#1785 for the
v3 branch.

Signed-off-by: Adam Williamson <[email protected]>
  • Loading branch information
AdamWill committed Jun 17, 2024
1 parent 0855bd6 commit 81707e5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions zarr/tests/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,9 @@ def test_hierarchy(self):
assert [] == store.listdir(self.root + "c/x/y")
assert [] == store.listdir(self.root + "c/d/y")
assert [] == store.listdir(self.root + "c/d/y/z")
assert [] == store.listdir(self.root + "c/e/f")
# https://github.com/zarr-developers/zarr-python/issues/1819 and #1679
# fsspec changed from returning [] to returning ["f"] around 2024.3
assert store.listdir(self.root + "c/e/f") in ([], ["f"])

# test rename (optional)
if store.is_erasable():
Expand Down Expand Up @@ -1152,9 +1154,8 @@ def test_complex(self):
store[self.root + "foo"] = b"hello"
assert "foo" in os.listdir(str(path1) + "/" + self.root)
assert self.root + "foo" in store
assert not os.listdir(str(path2))
assert store[self.root + "foo"] == b"hello"
assert "foo" in os.listdir(str(path2))
assert store[self.root + "foo"] == b"hello"

def test_deep_ndim(self):
import zarr
Expand Down

0 comments on commit 81707e5

Please sign in to comment.