diff --git a/src/tests/test_national.py b/src/tests/test_national.py index f4c99dfa..9ba50ad3 100644 --- a/src/tests/test_national.py +++ b/src/tests/test_national.py @@ -131,6 +131,7 @@ def test_get_national_forecast(db_session, api_client): != national_forecast.forecast_values[0].expected_power_generation_megawatts * 0.9 ) + def test_get_national_forecast_null_plevels(db_session, api_client): """Check main solar/GB/national/forecast route works""" @@ -154,12 +155,11 @@ def test_get_national_forecast_null_plevels(db_session, api_client): national_forecast = NationalForecast(**response.json()) assert national_forecast.forecast_values[0].plevels is not None assert ( - national_forecast.forecast_values[0].plevels["plevel_10"] - == national_forecast.forecast_values[0].expected_power_generation_megawatts * 0.8 + national_forecast.forecast_values[0].plevels["plevel_10"] + == national_forecast.forecast_values[0].expected_power_generation_megawatts * 0.8 ) - def test_read_latest_national_values_start_and_end_filters_include_metadata(db_session, api_client): """Check main solar/GB/national/forecast route works""" diff --git a/src/utils.py b/src/utils.py index 52584126..cec13069 100644 --- a/src/utils.py +++ b/src/utils.py @@ -166,7 +166,6 @@ def format_plevels(national_forecast_value: NationalForecastValue): # rename '10' and '90' to plevel_10 and plevel_90 for c in ["10", "90"]: if c in national_forecast_value.plevels.keys(): - # get value value = national_forecast_value.plevels.pop(c)