Skip to content

Commit 85a6362

Browse files
committed
Fix ModelChain tests
1 parent 42b7ab7 commit 85a6362

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

tests/test_modelchain.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -281,26 +281,26 @@ def test_wrong_density_correction_type(self):
281281

282282
def test_missing_cp_values(self):
283283
"""Raise TypeErrors due to missing cp-values"""
284-
with pytest.raises(TypeError):
285-
self.test_turbine = {'hub_height': 100,
286-
'rotor_diameter': 80,
287-
'turbine_type': 'E-126/4200',
288-
'power_coefficient_curve': False}
284+
test_turbine = {'hub_height': 100,
285+
'rotor_diameter': 80,
286+
'turbine_type': 'E-126/4201'}
287+
msg = "Power coefficient curve values of"
288+
with pytest.raises(TypeError, match=msg):
289289
test_modelchain = {'power_output_model': 'power_coefficient_curve',
290290
'density_correction': True}
291-
test_mc = mc.ModelChain(wt.WindTurbine(**self.test_turbine),
291+
test_mc = mc.ModelChain(wt.WindTurbine(**test_turbine),
292292
**test_modelchain)
293293
test_mc.run_model(self.weather_df)
294294

295295
def test_missing_p_values(self):
296296
"""Raise TypeErrors due to missing p-values"""
297-
with pytest.raises(TypeError):
298-
self.test_turbine = {'hub_height': 100,
299-
'rotor_diameter': 80,
300-
'turbine_type': 'E-126/4200',
301-
'power_curve': False}
297+
test_turbine = {'hub_height': 100,
298+
'rotor_diameter': 80,
299+
'turbine_type': 'E-126/4205'}
300+
msg = "Power curve values of"
301+
with pytest.raises(TypeError, match=msg):
302302
test_modelchain = {'power_output_model': 'power_curve',
303303
'density_corr': True}
304-
test_mc = mc.ModelChain(wt.WindTurbine(**self.test_turbine),
304+
test_mc = mc.ModelChain(wt.WindTurbine(**test_turbine),
305305
**test_modelchain)
306306
test_mc.run_model(self.weather_df)

0 commit comments

Comments
 (0)