@@ -38,6 +38,14 @@ def test_get_main_graph(mock_agent):
3838 assert "graph [splines=true];" in result
3939 assert 'node [fontname="Arial"];' in result
4040 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+ )
4149 assert (
4250 '"Agent1" [label="Agent1", shape=box, style=filled, '
4351 "fillcolor=lightyellow, width=1.5, height=0.8];" in result
@@ -58,6 +66,14 @@ def test_get_main_graph(mock_agent):
5866
5967def test_get_all_nodes (mock_agent ):
6068 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+ )
6177 assert (
6278 '"Agent1" [label="Agent1", shape=box, style=filled, '
6379 "fillcolor=lightyellow, width=1.5, height=0.8];" in result
@@ -78,20 +94,31 @@ def test_get_all_nodes(mock_agent):
7894
7995def test_get_all_edges (mock_agent ):
8096 result = get_all_edges (mock_agent )
97+ assert '"__start__" -> "Agent1";' in result
98+ assert '"Agent1" -> "__end__";'
8199 assert '"Agent1" -> "Tool1" [style=dotted, penwidth=1.5];' in result
82100 assert '"Tool1" -> "Agent1" [style=dotted, penwidth=1.5];' in result
83101 assert '"Agent1" -> "Tool2" [style=dotted, penwidth=1.5];' in result
84102 assert '"Tool2" -> "Agent1" [style=dotted, penwidth=1.5];' in result
85103 assert '"Agent1" -> "Handoff1";' in result
86104
87105
106+
88107def test_draw_graph (mock_agent ):
89108 graph = draw_graph (mock_agent )
90109 assert isinstance (graph , graphviz .Source )
91110 assert "digraph G" in graph .source
92111 assert "graph [splines=true];" in graph .source
93112 assert 'node [fontname="Arial"];' in graph .source
94113 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+ )
95122 assert (
96123 '"Agent1" [label="Agent1", shape=box, style=filled, '
97124 "fillcolor=lightyellow, width=1.5, height=0.8];" in graph .source
0 commit comments