Skip to content

Commit

Permalink
add test to wrap ugriddataset twice (should fail now)
Browse files Browse the repository at this point in the history
  • Loading branch information
veenstrajelmer authored Feb 2, 2024
1 parent a140d31 commit cb391e2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/test_ugrid_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def test_init_errors():
with pytest.raises(TypeError, match="obj must be xarray.DataArray"):
xugrid.UgridDataArray(0, GRID())
with pytest.raises(TypeError, match="grid must be Ugrid1d or Ugrid2d"):
xugrid.UgridDataArray(DARRAY(), 0)
.copy(), 0)

with pytest.raises(ValueError, match="At least either obj or grids is required"):
xugrid.UgridDataset()
Expand Down Expand Up @@ -1263,3 +1263,7 @@ def test_laplace_interpolate_1d():
actual = uda.ugrid.laplace_interpolate(direct_solve=True)
assert isinstance(actual, xugrid.UgridDataArray)
assert np.allclose(actual, 1.0)

def test_ugriddataset_wrap_twice():
_ = xugrid.UgridDataset(UGRID_DS)
_ = xugrid.UgridDataset(UGRID_DS)

0 comments on commit cb391e2

Please sign in to comment.