Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 20, 2024
1 parent 4ef0f02 commit e8c2e6c
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def test_dag_to_levles_4():

assert levels == {0: ["A", "B", "C"], 1: ["D", "E"]}


def test_dag_to_levels_5():
"""
```mermaid
Expand All @@ -85,13 +86,21 @@ def test_dag_to_levels_5():
```
"""
digraph = nx.DiGraph()
digraph.add_edges_from([
("A", "D"), ("B", "D"), ("B", "E"), ("C", "E"),
("D", "F"), ("E", "F"),
("B", "G"), ("E", "G"),
("F", "H"), ("C", "H"),
("G", "I")
])
digraph.add_edges_from(
[
("A", "D"),
("B", "D"),
("B", "E"),
("C", "E"),
("D", "F"),
("E", "F"),
("B", "G"),
("E", "G"),
("F", "H"),
("C", "H"),
("G", "I"),
]
)
levels = dag_to_levels(digraph)

assert levels == {0: ["A", "B", "C"], 1: ["D", "E"], 2: ["F", "G"], 3: ["H", "I"]}

0 comments on commit e8c2e6c

Please sign in to comment.