Skip to content

Commit 62a549e

Browse files
committed
add missing test
1 parent 4619a1e commit 62a549e

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

pvlib/tests/test_modelchain.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1259,6 +1259,15 @@ def test_infer_dc_model(sapm_dc_snl_ac_system, cec_dc_snl_ac_system,
12591259
assert isinstance(mc.results.dc, (pd.Series, pd.DataFrame))
12601260

12611261

1262+
def test_infer_dc_model_incomplete(multi_array_sapm_dc_snl_ac_system,
1263+
location):
1264+
match = 'Could not infer DC model from the module_parameters attributes '
1265+
system = multi_array_sapm_dc_snl_ac_system['two_array_system']
1266+
system.arrays[0].module_parameters.pop('A0')
1267+
with pytest.raises(ValueError, match=match):
1268+
ModelChain(system, location)
1269+
1270+
12621271
@pytest.mark.parametrize('dc_model', ['cec', 'desoto', 'pvsyst'])
12631272
def test_singlediode_dc_arrays(location, dc_model,
12641273
cec_dc_snl_ac_arrays,
@@ -1721,7 +1730,9 @@ def test_invalid_dc_model_params(sapm_dc_snl_ac_system, cec_dc_snl_ac_system,
17211730
kwargs['ac_model'] = 'pvwatts'
17221731
for array in pvwatts_dc_pvwatts_ac_system.arrays:
17231732
array.module_parameters.pop('pdc0')
1724-
with pytest.raises(ValueError):
1733+
1734+
match = 'one or more Arrays are missing one or more required parameters'
1735+
with pytest.raises(ValueError, match=match):
17251736
ModelChain(pvwatts_dc_pvwatts_ac_system, location, **kwargs)
17261737

17271738

0 commit comments

Comments
 (0)