Skip to content

Commit 79f78cc

Browse files
committed
add vindex test
1 parent b0af4a7 commit 79f78cc

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

tests/test_indexing.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2041,6 +2041,18 @@ async def test_async_oindex(self, store, indexer, expected):
20412041
result = await async_zarr.oindex.getitem(indexer)
20422042
assert_array_equal(result, expected)
20432043

2044+
@pytest.mark.parametrize(
2045+
"indexer,expected",
2046+
[
2047+
(([0], [0]), np.array(1)),
2048+
(([0, 1], [0, 1]), np.array([1, 4])),
2049+
],
2050+
)
20442051
@pytest.mark.asyncio
2045-
async def test_async_vindex(self):
2046-
...
2052+
async def test_async_vindex(self, store, indexer, expected):
2053+
z = zarr.create_array(store=store, shape=(2, 2), chunks=(1, 1), zarr_format=3, dtype="i8")
2054+
z[...] = np.array([[1, 2], [3, 4]])
2055+
async_zarr = z._async_array
2056+
2057+
result = await async_zarr.vindex.getitem(indexer)
2058+
assert_array_equal(result, expected)

0 commit comments

Comments
 (0)