Skip to content

Commit 16d4a59

Browse files
committed
fix a2a integ test
1 parent 148f281 commit 16d4a59

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

tests_integ/a2a/test_multiagent_a2a.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,23 @@
55

66
from strands.agent.a2a_agent import A2AAgent
77

8-
# Start our A2A server
9-
server_path = os.path.join(os.path.dirname(__file__), "a2a_server.py")
10-
server = subprocess.Popen(["python", server_path])
118

9+
def test_a2a_agent():
10+
# Start our A2A server
11+
server_path = os.path.join(os.path.dirname(__file__), "a2a_server.py")
12+
server = subprocess.Popen(["python", server_path])
1213

13-
def cleanup():
14-
server.terminate()
14+
def cleanup():
15+
server.terminate()
1516

17+
atexit.register(cleanup)
18+
time.sleep(5) # Wait for A2A server to start
1619

17-
atexit.register(cleanup)
18-
time.sleep(5) # Wait for A2A server to start
20+
# Connect to our A2A server
21+
a2a_agent = A2AAgent(endpoint="http://localhost:9000")
1922

20-
# Connect to our A2A server
21-
a2a_agent = A2AAgent(endpoint="http://localhost:9000")
23+
# Invoke our A2A server
24+
result = a2a_agent("Hello there!")
2225

23-
# Invoke our A2A server
24-
result = a2a_agent("Hello there!")
25-
26-
# TODO: assertions on result
26+
# Ensure that it was successful
27+
assert result.stop_reason == "end_turn"

0 commit comments

Comments
 (0)