Skip to content

Commit 70751af

Browse files
[test] Add test for graph cyclicConnections
1 parent 570c89f commit 70751af

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/test_graph.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
from meshroom.core.graph import Graph
2+
from meshroom.core.exception import CyclicDependencyError
3+
4+
import pytest
25

36

47
def test_depth():
@@ -278,3 +281,20 @@ def test_duplicate_nodes():
278281
assert nMap[n2][0].input.getLinkParam() == nMap[n1][0].output
279282
assert nMap[n3][0].input.getLinkParam() == nMap[n1][0].output
280283
assert nMap[n3][0].input2.getLinkParam() == nMap[n2][0].output
284+
285+
286+
def test_acyclic_connection_should_raise_error():
287+
288+
# Given
289+
graph = Graph("Test acyclic connection")
290+
tB = graph.addNewNode("AppendText", inputText="echo B")
291+
tC = graph.addNewNode("AppendText", inputText="echo C")
292+
293+
graph.addEdge(tB.output, tC.input)
294+
295+
# When
296+
# Then
297+
with pytest.raises(CyclicDependencyError):
298+
graph.addEdge(tC.output, tB.input)
299+
300+

0 commit comments

Comments
 (0)