Skip to content

Commit 851d075

Browse files
committed
Test deduce_nominal_power if power curve is None
1 parent e54a765 commit 851d075

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/test_wind_turbine.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ def test_deduce_nominal_power(self):
5050
n131.deduce_nominal_power_from_power_curve()
5151
assert n131.nominal_power == 3000000.0
5252

53+
def test_error_deduce_nominal_power_withour_p_curve(self):
54+
"""Test method to deduce nominal_power from power curve"""
55+
test_turbine_data = {'hub_height': 100,
56+
'rotor_diameter': 80,
57+
'turbine_type': 'N131/3050'}
58+
n131 = WindTurbine(**test_turbine_data)
59+
assert n131.nominal_power is None
60+
with pytest.raises(ValueError, match="You can not deduce the"):
61+
n131.deduce_nominal_power_from_power_curve()
62+
5363
def test_wrong_url_load_turbine_data(self):
5464
"""Load turbine data from oedb."""
5565

0 commit comments

Comments
 (0)