Skip to content

Commit

Permalink
Add test for malformated weather data
Browse files Browse the repository at this point in the history
  • Loading branch information
p-snft committed Oct 20, 2020
1 parent c9479d5 commit dee4f1d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion test/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def test_wind_feedin_scaling(
assert 833050.32551 / 3e6 == pytest.approx(feedin.values[0], 1e-5)


class TestGeometricSolar:
class TestGeometricSolar(Fixtures):
"""
Class to test GeometricSolar model and functions it depends on.
"""
Expand Down Expand Up @@ -239,6 +239,18 @@ def test_geometric_angles(self):
assert (plant4.feedin(data_weather_test)[0]
== pytest.approx(89.23768, 1e-5))

erroneous_weather = pd.DataFrame(data={'wind_speed': [5.0],
'temp_air': [10.0],
'dhi': [500],
'ghi': [300]},
index=pd.date_range('1/1/1970 12:00',
periods=1,
freq='H',
tz='UTC'))

with pytest.raises(ValueError):
assert plant4.feedin(weather=erroneous_weather)


class TestPvlib(Fixtures):
"""
Expand Down

0 comments on commit dee4f1d

Please sign in to comment.