diff --git a/src/tests/cucumber/features/short_tests.feature b/src/tests/cucumber/features/short_tests.feature index 62376274f5..847a67af58 100644 --- a/src/tests/cucumber/features/short_tests.feature +++ b/src/tests/cucumber/features/short_tests.feature @@ -1,16 +1,4 @@ Feature: short tests - - @fast @short - Scenario: 034 Mixed Expansion - Smart grid model 1 - # Like previous test, but with unit commitment - # => overall cost is better, there are less startups, and min up & down time are not equal - Given the study path is "short-tests/034 Mixed Expansion - Smart grid model 1" - When I run antares simulator - Then the simulation takes less than 10 seconds - And the simulation succeeds - And in area "B", during year 1, hourly production of "OIL" for "1 JAN 02:00" is 1974 - And in area "B", during year 1, hourly production of "OIL" for "1 JAN 02:00" is 1148 - @fast @short Scenario: 001 One node - passive Given the study path is "short-tests/001 One node - passive" @@ -142,3 +130,12 @@ Feature: short tests And the annual system cost is | EXP | STD | MIN | MAX | | 7.972e+10 | 2.258e+10 | 5.613e+10 | 1.082e+11 | + + @fast @short + Scenario: 034 Mixed Expansion - Smart grid model 1 + Given the study path is "short-tests/034 Mixed Expansion - Smart grid model 1" + When I run antares simulator + Then the simulation takes less than 10 seconds + And the simulation succeeds + And in area "b", during year 1, hourly production of "MIXED FUEL" for "1 JAN 01:00" is 27814 + And in area "b", during year 1, hourly production of "OIL" for "2 JAN 19:00" is 8113 diff --git a/src/tests/cucumber/features/steps/common_steps/steps.py b/src/tests/cucumber/features/steps/common_steps/steps.py index ea1d5b0594..87187f57c3 100644 --- a/src/tests/cucumber/features/steps/common_steps/steps.py +++ b/src/tests/cucumber/features/steps/common_steps/steps.py @@ -106,10 +106,10 @@ def check_prod_for_all_years(context, area, prod_name, comparator_and_hourly_pro for year in range(1, context.nbyears + 1): check_prod_for_specific_year(context, area, year, prod_name, comparator_and_hourly_prod) -@then('in area "{area}", during year {year:d}, hourly production of "{prod_name}" for "{date}" is {value}') +@then('in area "{area}", during year {year:d}, hourly production of "{prod_name}" for "{date}" is {value:d}') def check_prod_for_specific_year_and_hour(context, area, year, prod_name, date, value): actual_hourly_prod = context.soh.get_specific_value(area, year, prod_name, date) - assert actual_hourly_prod - value <= 1e-6 + assert actual_hourly_prod == value @step('in area "{area}", during year {year:d}, total non-proportional cost is {np_cost:g}') def check_np_cost_for_specific_year(context, area, year, np_cost): diff --git a/src/tests/cucumber/features/steps/common_steps/study_output_handler.py b/src/tests/cucumber/features/steps/common_steps/study_output_handler.py index e7eff2aa75..f447115e2f 100644 --- a/src/tests/cucumber/features/steps/common_steps/study_output_handler.py +++ b/src/tests/cucumber/features/steps/common_steps/study_output_handler.py @@ -79,8 +79,9 @@ def get_loss_of_load_duration_h(self, area: str, year: int) -> int: def get_unsupplied_energy_mwh(self, area: str, year: int, date: str) -> float: return self.__get_values_hourly_for_specific_hour(area, year, date)["UNSP. ENRG"]["MWh"].sum() - def get_specific_value(self, area: str, year: int, date: str, prod_name: str) -> float: - return self.__get_values_hourly_for_specific_hour(area, year, date)[prod_name]["MWh"] + + def get_specific_value(self, area: str, year: int, prod_name: str, date: str) -> float: + return self.__get_values_hourly_for_specific_hour(area, year, date)[prod_name]["MWh"].sum() def get_non_proportional_cost(self, area: str, year: int) -> float: return self.__get_values_hourly(area, year)["NP COST"]["Euro"].sum()