Skip to content

Commit 146297c

Browse files
committed
add a delete test
1 parent 9ebbd58 commit 146297c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/test_store/test_object.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,17 @@ async def test_store_getsize_prefix(self, store: ObjectStore) -> None:
9090
total_size = await store.getsize_prefix("c")
9191
assert total_size == len(buf) * 2
9292

93+
async def test_store_delete(self, store: ObjectStore) -> None:
94+
assert store.supports_deletes
95+
buf = cpu.Buffer.from_bytes(b"\x01\x02\x03\x04")
96+
await store.set("foo/1", buf)
97+
await store.set("foo/2", buf)
98+
await store.delete("foo/1")
99+
assert not await store.exists("foo/1")
100+
assert await store.exists("foo/2")
101+
await store.delete_dir("foo") # FileNotFoundErrors are suppressed
102+
assert not await store.exists("foo/2")
103+
93104

94105
@pytest.mark.slow_hypothesis
95106
def test_zarr_hierarchy():

0 commit comments

Comments
 (0)