Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
Signed-off-by: Coline PILOQUET <coline.piloquet@rte-france.com>
  • Loading branch information
colinepiloquet committed Feb 12, 2024
1 parent 4be0717 commit 5e1ec3b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public static VoltageLevel getVoltageLevelOrThrowWithBusOrBusbarSectionId(Networ
Identifiable<?> busOrBusbarSection = network.getIdentifiable(busOrBusbarSections.get(row));
if (busOrBusbarSection == null && throwException) {
throw new PowsyblException(String.format("Bus or busbar section %s not found.", busOrBusbarSections.get(row)));

}
if (busOrBusbarSection instanceof BusbarSection bbs) {
return bbs.getTerminal().getVoltageLevel();
Expand Down
2 changes: 1 addition & 1 deletion tests/test_network_modification.py
Original file line number Diff line number Diff line change
Expand Up @@ -1179,7 +1179,7 @@ def test_exception_create_element_with_bay():
data=[['new_line', 'S1VL2_BBS', 'S2VL1_BBS', 115, 121, 'TOP', 'TOP', 5.0, 50.0, 20.0, 30.0, 40.0,
50.0]])
with pytest.raises(PyPowsyblError) as exc:
pp.network.create_line_bays(n, df_line_wrong_bbs)
pp.network.create_line_bays(n, df_line_wrong_bbs, raise_exception=True)
assert exc.match('Bus or busbar section S1VL2_BBS not found')

pp.network.create_line_bays(network=n, df=df_line_wrong_bbs, raise_exception=False)
Expand Down

0 comments on commit 5e1ec3b

Please sign in to comment.