From 7d1314b5af985aeb6845cddee12b5fa01052215b Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Fri, 1 Dec 2023 10:15:32 +0000 Subject: [PATCH] update tests --- pv_site_api/main.py | 2 +- tests/test_forecast.py | 3 ++- tests/test_generation.py | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pv_site_api/main.py b/pv_site_api/main.py index c14400a..5efd2f9 100644 --- a/pv_site_api/main.py +++ b/pv_site_api/main.py @@ -346,7 +346,7 @@ def get_pv_actual_many_sites( return [] # convert to list of strings - if isinstance(site_uuids,str) + if isinstance(site_uuids,str): site_uuids_list = site_uuids.split(",") else: site_uuids_list = site_uuids diff --git a/tests/test_forecast.py b/tests/test_forecast.py index d419b8a..cee42c3 100644 --- a/tests/test_forecast.py +++ b/tests/test_forecast.py @@ -195,7 +195,8 @@ def test_get_forecast_no_data(db_session, client, sites): def test_get_forecast_no_data_multiple_sites(db_session, client): # Get forecasts from that site with no forecasts. resp = client.get("/sites/pv_forecast?site_uuids=[]") - assert resp.status_code == 204 + assert resp.status_code == 200 + assert resp.json() == [] def test_get_forecast_user_no_access(db_session, client, sites): diff --git a/tests/test_generation.py b/tests/test_generation.py index 94e126e..db53416 100644 --- a/tests/test_generation.py +++ b/tests/test_generation.py @@ -147,7 +147,8 @@ def test_pv_actual_no_data(db_session, client, sites): def test_pv_actual_no_data_multiple_sites(db_session, client): # Get forecasts from that site with no actuals. resp = client.get("/sites/pv_actual?site_uuids=[]") - assert resp.status_code == 204 + assert resp.status_code == 200 + assert resp.json() == [] def test_pv_actual_404(db_session, client):