diff --git a/tests/conftest.py b/tests/conftest.py index b61784c..018c36a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -15,7 +15,7 @@ import zarr from pvsite_datamodel import DatabaseConnection from pvsite_datamodel.read.model import get_or_create_model -from pvsite_datamodel.sqlmodels import Base, GenerationSQL, ForecastSQL, ForecastValueSQL, SiteSQL +from pvsite_datamodel.sqlmodels import Base, ForecastSQL, ForecastValueSQL, GenerationSQL, SiteSQL from sqlalchemy import create_engine from testcontainers.postgres import PostgresContainer diff --git a/tests/test_adjuster.py b/tests/test_adjuster.py index ec43b08..3c84cce 100644 --- a/tests/test_adjuster.py +++ b/tests/test_adjuster.py @@ -1,11 +1,13 @@ +""" Test for adjuster.py """ from datetime import datetime import pandas as pd -from india_forecast_app.adjuster import get_me_values, adjust_forecast_with_adjuster +from india_forecast_app.adjuster import adjust_forecast_with_adjuster, get_me_values def test_get_me_values_no_values(db_session, sites): + """Check no ME results are found with no forecast or generation values""" me_df = get_me_values(db_session, 10, site_uuid=sites[0].site_uuid, ml_model_name="test") @@ -13,6 +15,7 @@ def test_get_me_values_no_values(db_session, sites): def test_get_me_values(db_session, sites, generation_db_values, forecasts): + """Check ME results are found""" hour = pd.Timestamp(datetime.now()).hour me_df = get_me_values(db_session, hour, site_uuid=sites[0].site_uuid, ml_model_name="test") @@ -21,6 +24,7 @@ def test_get_me_values(db_session, sites, generation_db_values, forecasts): def test_get_me_values_no_generation(db_session, sites, forecasts): + """Check no ME results are found with no generation values""" hour = pd.Timestamp(datetime.now()).hour me_df = get_me_values(db_session, hour, site_uuid=sites[0].site_uuid, ml_model_name="test") @@ -29,6 +33,7 @@ def test_get_me_values_no_generation(db_session, sites, forecasts): def test_get_me_values_no_forecasts(db_session, sites, generation_db_values): + """Check no ME results are found with no generation values""" hour = pd.Timestamp(datetime.now()).hour me_df = get_me_values(db_session, hour, site_uuid=sites[0].site_uuid, ml_model_name="test") @@ -37,6 +42,7 @@ def test_get_me_values_no_forecasts(db_session, sites, generation_db_values): def test_adjust_forecast_with_adjuster(db_session, sites, generation_db_values, forecasts): + """Check forecast gets adjuster""" forecast_meta = {"timestamp_utc": datetime.now(), "site_uuid": sites[0].site_uuid} forecast_values_df = pd.DataFrame( { @@ -56,6 +62,7 @@ def test_adjust_forecast_with_adjuster(db_session, sites, generation_db_values, def test_adjust_forecast_with_adjuster_no_values(db_session, sites): + """Check forecast doesnt adjuster, no me values""" forecast_meta = {"timestamp_utc": datetime.now(), "site_uuid": sites[0].site_uuid} forecast_values_df = pd.DataFrame( {