From 99d03e093d12ad0600b3da70087788057c6c5ac7 Mon Sep 17 00:00:00 2001 From: pesap Date: Fri, 1 Nov 2024 12:33:21 -0600 Subject: [PATCH] test: More testing for the plugin --- tests/test_plugin_emission_cap.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/test_plugin_emission_cap.py b/tests/test_plugin_emission_cap.py index 115ae79..d014d56 100644 --- a/tests/test_plugin_emission_cap.py +++ b/tests/test_plugin_emission_cap.py @@ -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",