Skip to content

Commit

Permalink
test surface setter
Browse files Browse the repository at this point in the history
  • Loading branch information
jhdark committed Nov 2, 2023
1 parent e1abfab commit 8248d78
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/test_surface_quantity.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,16 @@ def test_writer(tmp_path):
expected_value = 10

assert computed_value == expected_value


def test_surface_setter_raises_TypeError():
"""Test that a TypeError is raised when the surface is not a
F.SurfaceSubdomain1D"""

with pytest.raises(
TypeError, match="surface should be an int or F.SurfaceSubdomain1D"
):
F.SurfaceQuantity(
field=F.Species("H"),
surface="1",
)

0 comments on commit 8248d78

Please sign in to comment.