PeacebinfLow commited on
Commit
2107765
·
verified ·
1 Parent(s): 6f89fe8

Create test_flow_graph.py

Browse files
Files changed (1) hide show
  1. tests_06/test_flow_graph.py +27 -0
tests_06/test_flow_graph.py ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from engine_03.flow.graph_models import table_to_flowgraph
2
+ from engine_03.flow.mermaid_renderer import build_mermaid
3
+ from engine_03.flow.simulator import simulate_flowgraph
4
+
5
+
6
+ def test_basic_flow():
7
+ nodes = [
8
+ ["a", "Start", "event"],
9
+ ["b", "Middle", "function"],
10
+ ["c", "End", "output"],
11
+ ]
12
+ edges = [
13
+ ["a", "b", ""],
14
+ ["b", "c", ""],
15
+ ]
16
+
17
+ flow = table_to_flowgraph(nodes, edges)
18
+ mermaid = build_mermaid(flow)
19
+ sim = simulate_flowgraph(flow)
20
+
21
+ assert "a[Start]" in mermaid
22
+ assert "b[Middle]" in mermaid
23
+ assert "c[End]" in mermaid
24
+
25
+ assert "Node `a`" in sim
26
+ assert "Node `b`" in sim
27
+ assert "Node `c`" in sim