Skip to content

Commit

Permalink
Add test for newly introduced error message
Browse files Browse the repository at this point in the history
  • Loading branch information
jokochems committed Nov 1, 2023
1 parent d67d4cf commit 2bfa151
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,14 @@ def test_sub_cell_flow_consideration():

m = solph.Model(energysystem=[es, ec_1])
assert test_flow in m.FLOWS


def test_fix_investments_for_unsolved_model():
"""test error message for unsolved model"""
es = solph.EnergySystem(timeincrement=[1])
om = solph.Model(es)
with pytest.raises(
ValueError,
match="Cannot fix investments as model has not yet been solved!",
):
om.fix_investments()

0 comments on commit 2bfa151

Please sign in to comment.