def test_different_voltage_levels_connected(test_net, diag_params, diag_errors, report_methods): net = copy.deepcopy(test_net) check_function = 'different_voltage_levels_connected' diag_params = copy.deepcopy(diag_params) report_methods = copy.deepcopy(report_methods) pp.create_switch(net, 41, 45, et='b') net.bus.vn_kv.loc[38] = 30 check_result = pp.different_voltage_levels_connected(net) if check_result: diag_results = {check_function: check_result} else: diag_results = {} assert diag_results[check_function] == \ {'lines': [6, 7], 'switches': [88]} for bool_value in [True, False]: diag_report = DiagnosticReports(net, diag_results, diag_errors, diag_params, compact_report=bool_value) report_check = None try: eval(report_methods[check_function]) report_check = True except: report_check = False assert report_check
def test_different_voltage_levels_connected(test_net): net = copy.deepcopy(test_net) pp.create_switch(net, 41, 45, et='b') net.bus.vn_kv.loc[38] = 30 assert pp.different_voltage_levels_connected(net) == \ {'lines': [6, 7], 'switches': [88]}