Skip to content

Commit

Permalink
fix tests (#324)
Browse files Browse the repository at this point in the history
* fix tests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* lint

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
peterdudfield and pre-commit-ci[bot] authored Mar 11, 2024
1 parent c68e5d3 commit dcef812
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/tests/test_national.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ def test_read_latest_national_values_start_and_end_filters(db_session, api_clien
assert len(national_forecast_values) == 9


@freeze_time("2024-01-01")
def test_get_national_forecast(db_session, api_client):
"""Check main solar/GB/national/forecast route works"""

Expand Down Expand Up @@ -212,8 +213,10 @@ def test_read_latest_national_values_properties(db_session, api_client):
national_forecast_values = [NationalForecastValue(**f) for f in response.json()]
assert national_forecast_values[0].plevels is not None
# index 24 is the middle of the day
assert np.round(national_forecast_values[24].plevels["plevel_10"], 2) == np.round(
national_forecast_values[24].expected_power_generation_megawatts * 0.9, 2
assert np.abs(
np.round(national_forecast_values[24].plevels["plevel_10"], 2)
- np.round(national_forecast_values[24].expected_power_generation_megawatts * 0.9, 2)
< 0.02
)


Expand Down

0 comments on commit dcef812

Please sign in to comment.