File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -129,3 +129,19 @@ def test_open_mode(tmp_path, mode):
129129 af ["arr" ][0 , 0 ] = 1
130130 else :
131131 raise Exception (f"Unknown mode { mode } " )
132+
133+
134+ @pytest .mark .parametrize ("meta_store" , [True , False ])
135+ def test_to_internal (meta_store ):
136+ if meta_store :
137+ zarr = create_zarray (store = KVStore ({}), chunk_store = TempStore ())
138+ else :
139+ zarr = create_zarray (store = TempStore ())
140+ internal = asdf_zarr .storage .to_internal (zarr )
141+ assert isinstance (internal .chunk_store , asdf_zarr .storage .InternalStore )
142+ # the store shouldn't be wrapped if it's not used for chunks
143+ if zarr .store is not zarr .chunk_store :
144+ assert isinstance (internal .store , KVStore )
145+ # calling it a second time shouldn't re-wrap the store
146+ same = asdf_zarr .storage .to_internal (internal )
147+ assert same .chunk_store is internal .chunk_store
You can’t perform that action at this time.
0 commit comments