Skip to content

Commit

Permalink
Add test to verify reversed branches also work with .has_branch() (#15)
Browse files Browse the repository at this point in the history
Signed-off-by: Thijs Baaijen <[email protected]>
  • Loading branch information
Thijss authored Jan 23, 2025
1 parent 4a36057 commit 13c8664
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/unit/model/graphs/test_graph_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ def test_graph_initialize(graph):
assert 1 == graph.nr_branches


def test_graph_has_branch(graph):
graph.add_node(1)
graph.add_node(2)
graph.add_branch(1, 2)

assert graph.has_branch(1, 2)
assert graph.has_branch(2, 1) # reversed should work too
assert not graph.has_branch(1, 3)


def test_graph_delete_branch(graph):
"""Test whether a branch is deleted correctly"""
graph.add_node(1)
Expand Down

0 comments on commit 13c8664

Please sign in to comment.