Skip to content

Commit 312c298

Browse files
committed
Strenghten serialization test
1 parent a52048d commit 312c298

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/zarr/testing/store.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,16 @@ def test_store_eq(self, store: S, store_kwargs: dict[str, Any]) -> None:
9999
store2 = self.store_cls(**store_kwargs)
100100
assert store == store2
101101

102-
def test_serializable_store(self, store: S) -> None:
102+
async def test_serializable_store(self, store: S) -> None:
103103
new_store: S = pickle.loads(pickle.dumps(store))
104104
assert new_store == store
105105
assert new_store.read_only == store.read_only
106+
# quickly roundtrip data to a key to test that new store works
107+
data_buf = self.buffer_cls.from_bytes(b"\x01\x02\x03\x04")
108+
key = "foo"
109+
await store.set(key, data_buf)
110+
observed = await store.get(key, prototype=default_buffer_prototype())
111+
assert_bytes_equal(observed, data_buf)
106112

107113
def test_store_read_only(self, store: S) -> None:
108114
assert not store.read_only

0 commit comments

Comments
 (0)