@@ -1259,6 +1259,15 @@ def test_infer_dc_model(sapm_dc_snl_ac_system, cec_dc_snl_ac_system,
1259
1259
assert isinstance (mc .results .dc , (pd .Series , pd .DataFrame ))
1260
1260
1261
1261
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
+
1262
1271
@pytest .mark .parametrize ('dc_model' , ['cec' , 'desoto' , 'pvsyst' ])
1263
1272
def test_singlediode_dc_arrays (location , dc_model ,
1264
1273
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,
1721
1730
kwargs ['ac_model' ] = 'pvwatts'
1722
1731
for array in pvwatts_dc_pvwatts_ac_system .arrays :
1723
1732
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 ):
1725
1736
ModelChain (pvwatts_dc_pvwatts_ac_system , location , ** kwargs )
1726
1737
1727
1738
0 commit comments