@@ -38,6 +38,14 @@ def test_get_main_graph(mock_agent):
38
38
assert "graph [splines=true];" in result
39
39
assert 'node [fontname="Arial"];' in result
40
40
assert "edge [penwidth=1.5];" in result
41
+ assert (
42
+ '"__start__" [label="__start__", shape=ellipse, style=filled, '
43
+ "fillcolor=lightblue, width=0.5, height=0.3];" in result
44
+ )
45
+ assert (
46
+ '"__end__" [label="__end__", shape=ellipse, style=filled, '
47
+ "fillcolor=lightblue, width=0.5, height=0.3];" in result
48
+ )
41
49
assert (
42
50
'"Agent1" [label="Agent1", shape=box, style=filled, '
43
51
"fillcolor=lightyellow, width=1.5, height=0.8];" in result
@@ -58,6 +66,14 @@ def test_get_main_graph(mock_agent):
58
66
59
67
def test_get_all_nodes (mock_agent ):
60
68
result = get_all_nodes (mock_agent )
69
+ assert (
70
+ '"__start__" [label="__start__", shape=ellipse, style=filled, '
71
+ "fillcolor=lightblue, width=0.5, height=0.3];" in result
72
+ )
73
+ assert (
74
+ '"__end__" [label="__end__", shape=ellipse, style=filled, '
75
+ "fillcolor=lightblue, width=0.5, height=0.3];" in result
76
+ )
61
77
assert (
62
78
'"Agent1" [label="Agent1", shape=box, style=filled, '
63
79
"fillcolor=lightyellow, width=1.5, height=0.8];" in result
@@ -78,20 +94,31 @@ def test_get_all_nodes(mock_agent):
78
94
79
95
def test_get_all_edges (mock_agent ):
80
96
result = get_all_edges (mock_agent )
97
+ assert '"__start__" -> "Agent1";' in result
98
+ assert '"Agent1" -> "__end__";'
81
99
assert '"Agent1" -> "Tool1" [style=dotted, penwidth=1.5];' in result
82
100
assert '"Tool1" -> "Agent1" [style=dotted, penwidth=1.5];' in result
83
101
assert '"Agent1" -> "Tool2" [style=dotted, penwidth=1.5];' in result
84
102
assert '"Tool2" -> "Agent1" [style=dotted, penwidth=1.5];' in result
85
103
assert '"Agent1" -> "Handoff1";' in result
86
104
87
105
106
+
88
107
def test_draw_graph (mock_agent ):
89
108
graph = draw_graph (mock_agent )
90
109
assert isinstance (graph , graphviz .Source )
91
110
assert "digraph G" in graph .source
92
111
assert "graph [splines=true];" in graph .source
93
112
assert 'node [fontname="Arial"];' in graph .source
94
113
assert "edge [penwidth=1.5];" in graph .source
114
+ assert (
115
+ '"__start__" [label="__start__", shape=ellipse, style=filled, '
116
+ "fillcolor=lightblue, width=0.5, height=0.3];" in graph .source
117
+ )
118
+ assert (
119
+ '"__end__" [label="__end__", shape=ellipse, style=filled, '
120
+ "fillcolor=lightblue, width=0.5, height=0.3];" in graph .source
121
+ )
95
122
assert (
96
123
'"Agent1" [label="Agent1", shape=box, style=filled, '
97
124
"fillcolor=lightyellow, width=1.5, height=0.8];" in graph .source
0 commit comments