Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdudfield committed Sep 26, 2023
1 parent 55771b7 commit b642e6b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/tests/test_gsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,25 @@ def test_read_latest_one_gsp(db_session, api_client):

_ = [ForecastValue(**f) for f in response.json()]


@freeze_time("2022-01-01")
def test_read_latest_one_gsp_national(db_session, api_client):
"""Check main solar/GB/gsp/{gsp_id}/forecast route works"""

forecasts = make_fake_forecasts(
gsp_ids=list(range(0, 2)), session=db_session, add_latest=True, model_name="blend"
)
db_session.add_all(forecasts)
db_session.commit()

app.dependency_overrides[get_session] = lambda: db_session

response = api_client.get("/v0/solar/GB/gsp/0/forecast")

assert response.status_code == 200

_ = [ForecastValue(**f) for f in response.json()]


def test_read_latest_one_gsp_filter_creation_utc(db_session, api_client):
"""Check main solar/GB/gsp/{gsp_id}/forecast route works"""
Expand Down

0 comments on commit b642e6b

Please sign in to comment.