()
| 122 | |
| 123 | |
| 124 | def test_three_node_cycle() -> None: |
| 125 | graph = dataflow.DirectedGraph() |
| 126 | graph.register_cell("0", parse_cell("x = y")) |
| 127 | graph.register_cell("1", parse_cell("y = z")) |
| 128 | graph.register_cell("2", parse_cell("z = x")) |
| 129 | errors = check_for_errors(graph) |
| 130 | assert set(errors.keys()) == {"0", "1", "2"} |
| 131 | for t in errors.values(): |
| 132 | assert len(t) == 1 |
| 133 | assert isinstance(t[0], CycleError) |
| 134 | edges_with_vars = t[0].edges_with_vars |
| 135 | assert len(edges_with_vars) == 3 |
| 136 | assert ("0", ("x",), "2") in edges_with_vars |
| 137 | assert ("1", ("y",), "0") in edges_with_vars |
| 138 | assert ("2", ("z",), "1") in edges_with_vars |
| 139 | |
| 140 | |
| 141 | def test_cycle_and_multiple_def() -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…