Skip to content

Commit b24f16a

Browse files
committed
Add test and
DCO Remediation Commit for Thijs Baaijen <[email protected]> I, Thijs Baaijen <[email protected]>, hereby add my Signed-off-by to this commit: b1601a8 I, Thijs Baaijen <[email protected]>, hereby add my Signed-off-by to this commit: 0598eb8 I, Thijs Baaijen <[email protected]>, hereby add my Signed-off-by to this commit: 82d52f9 Signed-off-by: Thijs Baaijen <[email protected]>
1 parent 96dc3cb commit b24f16a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/unit/model/graphs/test_graph_model.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import pytest
1111
from numpy.testing import assert_array_equal
1212

13+
from power_grid_model_ds._core.model.graphs.errors import GraphError
1314
from power_grid_model_ds._core.model.graphs.models.base import BaseGraphModel
1415
from power_grid_model_ds._core.model.grids.base import Grid
1516
from power_grid_model_ds.errors import MissingBranchError, MissingNodeError, NoPathBetweenNodes
@@ -30,6 +31,11 @@ def test_graph_add_node_and_branch(self, graph: BaseGraphModel):
3031
assert 2 == graph.nr_nodes
3132
assert 1 == graph.nr_branches
3233

34+
def test_add_node_already_there(self, graph: BaseGraphModel):
35+
graph.add_node(1)
36+
with pytest.raises(GraphError):
37+
graph.add_node(1)
38+
3339
def test_add_invalid_branch(self, graph: BaseGraphModel):
3440
graph.add_node(1)
3541
graph.add_node(2)

0 commit comments

Comments
 (0)