@@ -230,7 +230,8 @@ def test_handle_id_not_found_error():
230
230
PowerGridModel (input_data = {"node" : node_input , "source" : source_input })
231
231
232
232
233
- def test_handle_invalid_measured_object_error ():
233
+ @pytest .mark .parametrize ("sensor_type" , ["sym_power_sensor" , "sym_current_sensor" ])
234
+ def test_handle_invalid_measured_object_error (sensor_type ):
234
235
node_input = initialize_array ("input" , "node" , 2 )
235
236
node_input ["id" ] = [0 , 1 ]
236
237
node_input ["u_rated" ] = [0.0 , 0.0 ]
@@ -240,13 +241,13 @@ def test_handle_invalid_measured_object_error():
240
241
link_input ["from_node" ] = [0 ]
241
242
link_input ["to_node" ] = [1 ]
242
243
243
- sym_power_sensor_input = initialize_array ("input" , "sym_power_sensor" , 1 )
244
- sym_power_sensor_input ["id" ] = [3 ]
245
- sym_power_sensor_input ["measured_object" ] = [2 ]
246
- sym_power_sensor_input ["measured_terminal_type" ] = [MeasuredTerminalType .branch_from ]
244
+ sensor_input = initialize_array ("input" , sensor_type , 1 )
245
+ sensor_input ["id" ] = [3 ]
246
+ sensor_input ["measured_object" ] = [2 ]
247
+ sensor_input ["measured_terminal_type" ] = [MeasuredTerminalType .branch_from ]
247
248
248
249
with pytest .raises (InvalidMeasuredObject ):
249
- PowerGridModel (input_data = {"node" : node_input , "link" : link_input , "sym_power_sensor" : sym_power_sensor_input })
250
+ PowerGridModel (input_data = {"node" : node_input , "link" : link_input , sensor_type : sensor_input })
250
251
251
252
252
253
def test_handle_invalid_regulated_object_error ():
0 commit comments