Skip to content

Commit 13c8664

Browse files
authored
Add test to verify reversed branches also work with .has_branch() (#15)
Signed-off-by: Thijs Baaijen <13253091+Thijss@users.noreply.github.com>
1 parent 4a36057 commit 13c8664

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/unit/model/graphs/test_graph_model.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ def test_graph_initialize(graph):
2727
assert 1 == graph.nr_branches
2828

2929

30+
def test_graph_has_branch(graph):
31+
graph.add_node(1)
32+
graph.add_node(2)
33+
graph.add_branch(1, 2)
34+
35+
assert graph.has_branch(1, 2)
36+
assert graph.has_branch(2, 1) # reversed should work too
37+
assert not graph.has_branch(1, 3)
38+
39+
3040
def test_graph_delete_branch(graph):
3141
"""Test whether a branch is deleted correctly"""
3242
graph.add_node(1)

0 commit comments

Comments
 (0)