Skip to content

Commit

Permalink
assert that ValueError is raised
Browse files Browse the repository at this point in the history
  • Loading branch information
navidcy committed Apr 23, 2024
1 parent cba89f4 commit 3f163a2
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions tests/test_expt_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,47 @@ def test_ocean_forcing(
)


with pytest.raises(ValueError) as excinfo:
expt.initial_condition(
tmp_path / "ic_without_u_unprocessed",
varnames,
arakawa_grid="A",
)
assert str(excinfo.value) == "Error while reading initial condition velocities. Terminating!"

with pytest.raises(ValueError) as excinfo:
expt.initial_condition(
tmp_path / "ic_without_v_unprocessed",
varnames,
arakawa_grid="A",
)
assert str(excinfo.value) == "Error while reading initial condition velocities. Terminating!"

with pytest.raises(ValueError) as excinfo:
expt.initial_condition(
tmp_path / "ic_without_temp_unprocessed",
varnames,
arakawa_grid="A",
)
assert str(excinfo.value) == "Error while reading initial condition tracers. Terminating!"

with pytest.raises(ValueError) as excinfo:
expt.initial_condition(
tmp_path / "ic_without_salt_unprocessed",
varnames,
arakawa_grid="A",
)
assert str(excinfo.value) == "Error while reading initial condition tracers. Terminating!"

with pytest.raises(ValueError) as excinfo:
expt.initial_condition(
tmp_path / "ic_without_eta_unprocessed",
varnames,
arakawa_grid="A",
)
assert str(excinfo.value) == "Error while reading initial condition free surface. Terminating!"


@pytest.mark.parametrize(
(
"longitude_extent",
Expand Down

0 comments on commit 3f163a2

Please sign in to comment.