Skip to content

Commit

Permalink
tests: add repr(CarbonIntensityPointEstimate) test
Browse files Browse the repository at this point in the history
  • Loading branch information
abhidg committed May 28, 2024
1 parent 5851f9f commit be1334d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/test_windowed_forecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ def sample_data():
return data


def test_repr():
est = CarbonIntensityPointEstimate(
datetime=datetime.fromisoformat("2023-05-04T12:30+00:00"), value=12.0
)
assert repr(est) == "2023-05-04T12:30:00+00:00\t12.0"


def test_has_right_length():
window_size = 160 # In number of time intervals
wf = WindowedForecast(DATA, window_size, start=DATA[0].datetime)
Expand Down Expand Up @@ -83,6 +90,7 @@ def test_minimise_average(sample_data):
)
assert result == expected


def test_maximum_duration(sample_data):
window_size = 95 # corresponds to 2850 minutes
# Data points separated by 30 minutes intervals
Expand Down

0 comments on commit be1334d

Please sign in to comment.