Skip to content

Commit

Permalink
test: More testing for the plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
pesap committed Nov 1, 2024
1 parent fa0d23a commit 99d03e0
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/test_plugin_emission_cap.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,28 @@ def test_emission_but_no_cap(caplog):
assert "Could not set emission cap value" in caplog.text


def test_multiple_constraint_maps():
system = System(name="Test")
emission = Emission(
name="co2_emission", rate=10, generator_name="test_generator", emission_type=EmissionType.CO2
)
constraint_map = ConstraintMap(name="Constraints")
constraint_map2 = ConstraintMap(name="Constraints")
system.add_components(constraint_map, constraint_map2)
system.add_component(emission)
config = Scenario.from_kwargs(
name="Pacific",
input_model="reeds-US",
output_model="plexos",
solve_year=2035,
weather_year=2012,
plugins=["emission_cap"],
)

with pytest.raises(NotImplementedError):
_ = update_system(config=config, system=system, emission_cap=0.0)


def test_update_system_using_cli(reeds_data_folder, tmp_folder):
config = Scenario.from_kwargs(
name="Pacific",
Expand Down

0 comments on commit 99d03e0

Please sign in to comment.