File size: 689 Bytes
2107765
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from engine_03.flow.graph_models import table_to_flowgraph
from engine_03.flow.mermaid_renderer import build_mermaid
from engine_03.flow.simulator import simulate_flowgraph


def test_basic_flow():
    nodes = [
        ["a", "Start", "event"],
        ["b", "Middle", "function"],
        ["c", "End", "output"],
    ]
    edges = [
        ["a", "b", ""],
        ["b", "c", ""],
    ]

    flow = table_to_flowgraph(nodes, edges)
    mermaid = build_mermaid(flow)
    sim = simulate_flowgraph(flow)

    assert "a[Start]" in mermaid
    assert "b[Middle]" in mermaid
    assert "c[End]" in mermaid

    assert "Node `a`" in sim
    assert "Node `b`" in sim
    assert "Node `c`" in sim