From ab871afdddd0659b6d34f1b3da8c07dbca587f68 Mon Sep 17 00:00:00 2001 From: David Stansby Date: Mon, 14 Apr 2025 16:08:33 +0200 Subject: [PATCH] Add test for .like() with a zarr Array --- tests/test_pydantic_zarr/test_v2.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_pydantic_zarr/test_v2.py b/tests/test_pydantic_zarr/test_v2.py index 8ed3b09..13ac8ed 100644 --- a/tests/test_pydantic_zarr/test_v2.py +++ b/tests/test_pydantic_zarr/test_v2.py @@ -564,6 +564,13 @@ def test_array_like() -> None: assert a.like(c, include={"dtype"}) +def test_array_like_with_zarr() -> None: + arr = ArraySpec(shape=(1,), dtype="uint8", chunks=(1,)) + store = zarr.storage.MemoryStore() + arr_stored = arr.to_zarr(store, path="arr") + assert arr.like(arr_stored) + + # todo: parametrize def test_group_like() -> None: tree = {