|
11 | 11 | from zarr.storage._utils import normalize_path |
12 | 12 |
|
13 | 13 |
|
| 14 | +@pytest.mark.parametrize("path", ["foo", "foo/bar"]) |
14 | 15 | @pytest.mark.parametrize("write_group", [True, False]) |
15 | 16 | @pytest.mark.parametrize("zarr_format", [2, 3]) |
16 | | -async def test_contains_group(local_store, write_group: bool, zarr_format: ZarrFormat) -> None: |
| 17 | +async def test_contains_group( |
| 18 | + local_store, path: str, write_group: bool, zarr_format: ZarrFormat |
| 19 | +) -> None: |
17 | 20 | """ |
18 | 21 | Test that the contains_group method correctly reports the existence of a group. |
19 | 22 | """ |
20 | 23 | root = Group.from_store(store=local_store, zarr_format=zarr_format) |
21 | 24 | if write_group: |
22 | | - root.create_group("foo") |
23 | | - store_path = StorePath(local_store, path="foo") |
| 25 | + root.create_group(path) |
| 26 | + store_path = StorePath(local_store, path=path) |
24 | 27 | assert await contains_group(store_path, zarr_format=zarr_format) == write_group |
25 | 28 |
|
26 | 29 |
|
| 30 | +@pytest.mark.parametrize("path", ["foo", "foo/bar"]) |
27 | 31 | @pytest.mark.parametrize("write_array", [True, False]) |
28 | 32 | @pytest.mark.parametrize("zarr_format", [2, 3]) |
29 | | -async def test_contains_array(local_store, write_array: bool, zarr_format: ZarrFormat) -> None: |
| 33 | +async def test_contains_array( |
| 34 | + local_store, path: str, write_array: bool, zarr_format: ZarrFormat |
| 35 | +) -> None: |
30 | 36 | """ |
31 | 37 | Test that the contains array method correctly reports the existence of an array. |
32 | 38 | """ |
33 | 39 | root = Group.from_store(store=local_store, zarr_format=zarr_format) |
34 | 40 | if write_array: |
35 | | - root.create_array("foo", shape=(100,), chunks=(10,), dtype="i4") |
36 | | - store_path = StorePath(local_store, path="foo") |
| 41 | + root.create_array(path, shape=(100,), chunks=(10,), dtype="i4") |
| 42 | + store_path = StorePath(local_store, path=path) |
37 | 43 | assert await contains_array(store_path, zarr_format=zarr_format) == write_array |
38 | 44 |
|
39 | 45 |
|
|
0 commit comments