Skip to content

Commit

Permalink
Add more general asserts for xarray zarr test
Browse files Browse the repository at this point in the history
  • Loading branch information
jbusecke committed Nov 6, 2024
1 parent 7a9b5c5 commit 31ec860
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/test_end_to_end.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,13 @@ def test_xarray_zarr(
)

ds = xr.open_dataset(os.path.join(tmp_target.root_path, "store"), engine="zarr")
assert ds.time.encoding["chunks"] == (target_chunks["time"],)
xr.testing.assert_equal(ds.load(), daily_xarray_dataset)
ds = ds.load()
for dim, chunk_size in target_chunks.items():
assert ds[dim].encoding["chunks"] == (chunk_size,)
for dim, length in ds.sizes.items():
if dim not in target_chunks:
assert len(ds[dim]) == length
xr.testing.assert_equal(ds, daily_xarray_dataset)


def test_xarray_zarr_subpath(
Expand Down

0 comments on commit 31ec860

Please sign in to comment.