Skip to content

Commit

Permalink
fix,
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdudfield committed Jan 27, 2025
1 parent b533827 commit 76d76bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/gsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def get_all_available_forecasts(
# be default dont get any historic days
if start_datetime_utc is None:
start_datetime_utc = datetime.now(tz=timezone.utc).replace(
hour=0, minute=0, second=0, microsecond=0
minute=0, second=0, microsecond=0
)

forecasts = get_forecasts_from_database(
Expand Down
8 changes: 4 additions & 4 deletions src/tests/test_gsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def test_read_latest_all_gsp(db_session, api_client):

r = ManyForecasts(**response.json())
assert len(r.forecasts) == 10
assert len(r.forecasts[0].forecast_values) == 45
assert len(r.forecasts[0].forecast_values) == 16


def test_read_latest_all_gsp_filter_gsp(db_session, api_client):
Expand All @@ -139,7 +139,7 @@ def test_read_latest_all_gsp_filter_gsp(db_session, api_client):

r = ManyForecasts(**response.json())
assert len(r.forecasts) == 3
assert len(r.forecasts[0].forecast_values) == 45
assert len(r.forecasts[0].forecast_values) == 16


def test_read_latest_gsp_id_greater_than_total(db_session, api_client):
Expand Down Expand Up @@ -217,7 +217,7 @@ def test_read_latest_all_gsp_historic(db_session, api_client):
r = ManyForecasts(**response.json())

assert len(r.forecasts) == 9 # dont get national
assert len(r.forecasts[0].forecast_values) == 45
assert len(r.forecasts[0].forecast_values) == 16
assert r.forecasts[0].forecast_values[0].expected_power_generation_megawatts <= 13000
assert r.forecasts[1].forecast_values[0].expected_power_generation_megawatts <= 10

Expand Down Expand Up @@ -245,7 +245,7 @@ def test_read_latest_all_gsp_historic_compact(db_session, api_client):

r = [OneDatetimeManyForecastValues(**f) for f in response.json()]

assert len(r) == 45
assert len(r) == 16
assert len(r[0].forecast_values) == 9 # dont get the national
assert r[0].forecast_values[1] <= 13000

Expand Down

0 comments on commit 76d76bb

Please sign in to comment.