@@ -1645,17 +1645,24 @@ async def test_create_hierarchy_existing_nodes(
16451645
16461646@pytest .mark .parametrize ("store" , ["memory" ], indirect = True )
16471647@pytest .mark .parametrize ("overwrite" , [True , False ])
1648+ @pytest .mark .parametrize ("group_path" , ["" , "foo" ])
16481649@pytest .mark .parametrize ("impl" , ["async" , "sync" ])
16491650async def test_group_create_hierarchy (
1650- store : Store , zarr_format : ZarrFormat , overwrite : bool , impl : Literal ["async" , "sync" ]
1651+ store : Store ,
1652+ zarr_format : ZarrFormat ,
1653+ overwrite : bool ,
1654+ group_path : str ,
1655+ impl : Literal ["async" , "sync" ],
16511656) -> None :
16521657 """
16531658 Test that the Group.create_hierarchy method creates specified nodes and returns them in a dict.
16541659 Also test that off-target nodes are not deleted, and that the root group is not deleted
16551660 """
16561661 root_attrs = {"root" : True }
1657- g = Group .from_store (store , zarr_format = zarr_format , attributes = root_attrs )
1658-
1662+ g = sync_group .create_rooted_hierarchy (
1663+ store = store ,
1664+ nodes = {group_path : GroupMetadata (zarr_format = zarr_format , attributes = root_attrs )},
1665+ )
16591666 node_spec = {
16601667 "a" : GroupMetadata (zarr_format = zarr_format , attributes = {"name" : "a" }),
16611668 "a/b" : GroupMetadata (zarr_format = zarr_format , attributes = {"name" : "a/b" }),
@@ -1689,7 +1696,10 @@ async def test_group_create_hierarchy(
16891696 else :
16901697 assert all_members [k ].metadata == v == extant_created [k ].metadata
16911698 # ensure that we left the root group as-is
1692- assert sync_group .get_node (store = store , path = "" , zarr_format = zarr_format ).attrs == root_attrs
1699+ assert (
1700+ sync_group .get_node (store = store , path = group_path , zarr_format = zarr_format ).attrs .asdict ()
1701+ == root_attrs
1702+ )
16931703
16941704
16951705@pytest .mark .parametrize ("store" , ["memory" ], indirect = True )
0 commit comments