Skip to content

Commit

Permalink
Merge commit 'fb269f357e0a9e507c44d37bff3ccebdee8d382a' into issue/2-…
Browse files Browse the repository at this point in the history
…hour-backfill
  • Loading branch information
peterdudfield committed Sep 17, 2024
2 parents 31ca296 + fb269f3 commit e2c2d6a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

from gspconsumer.app import app, pull_data_and_save

from freezegun import freeze_time


def make_national(db_connection):
gsps = [
Expand Down Expand Up @@ -47,6 +49,7 @@ def test_app(db_connection, input_data_last_updated_sql):
assert len(gsp_yields) >= 11


@freeze_time("2024-09-16 12:00:00")
def test_app_day_after(db_connection, input_data_last_updated_sql):
make_national(db_connection)

Expand All @@ -67,6 +70,7 @@ def test_app_day_after(db_connection, input_data_last_updated_sql):
# 8 half hour settlement periods + midnight


@freeze_time("2024-09-16 12:00:00")
def test_app_day_after_national_only(db_connection, input_data_last_updated_sql):
make_national(db_connection)

Expand All @@ -85,6 +89,7 @@ def test_app_day_after_national_only(db_connection, input_data_last_updated_sql)
assert len(gsp_yields) == 1 * 49 # 1 gsps with 48 half hour settlement periods + midnight


@freeze_time("2024-09-16 12:00:00")
def test_app_day_after_gsp_only(db_connection, input_data_last_updated_sql):
runner = CliRunner()
response = runner.invoke(
Expand All @@ -111,6 +116,7 @@ def test_app_day_after_gsp_only(db_connection, input_data_last_updated_sql):
assert len(gsp_yields) == 5 * 49 # 5 gsps with 48 half hour settlement periods + midnight


@freeze_time("2024-09-16 12:00:00")
def test_app_day_after_gsp_only_after_national(db_connection, input_data_last_updated_sql):
"""
First just get National, then get all gsps
Expand Down

0 comments on commit e2c2d6a

Please sign in to comment.