55
66Prerequisites:
77 - AgentEx services running (make dev)
8- - An agentic agent running (e.g., tutorial 10_agentic)
8+ - An agentic agent running (e.g., tutorial 10_agentic/00_base/000_hello_acp)
9+
10+ Setup:
11+ 1. List available agents: agentex agents list
12+ 2. Copy an agent name from the output
13+ 3. Update AGENT_NAME below
914
1015Run:
1116 pytest test_agentic_agent.py -v
1520
1621from agentex .lib .testing import assert_valid_agent_response , test_agentic_agent
1722
23+ # TODO: Replace with your actual agent name from 'agentex agents list'
24+ AGENT_NAME = "ab000-hello-acp"
25+
1826
1927@pytest .mark .asyncio
2028async def test_agentic_agent_responds ():
2129 """Test that agentic agent responds to events."""
22- async with test_agentic_agent () as test :
30+ async with test_agentic_agent (agent_name = AGENT_NAME ) as test :
2331 # Send event and wait for response
2432 response = await test .send_event ("Hello! How are you?" , timeout_seconds = 15.0 )
2533
@@ -31,7 +39,7 @@ async def test_agentic_agent_responds():
3139@pytest .mark .asyncio
3240async def test_agentic_agent_multi_turn ():
3341 """Test that agentic agent handles multi-turn conversation."""
34- async with test_agentic_agent () as test :
42+ async with test_agentic_agent (agent_name = AGENT_NAME ) as test :
3543 # First exchange
3644 response1 = await test .send_event ("Hello!" , timeout_seconds = 15.0 )
3745 assert_valid_agent_response (response1 )
@@ -51,7 +59,7 @@ async def test_agentic_agent_multi_turn():
5159@pytest .mark .asyncio
5260async def test_agentic_agent_context ():
5361 """Test that agentic agent maintains conversation context."""
54- async with test_agentic_agent () as test :
62+ async with test_agentic_agent (agent_name = AGENT_NAME ) as test :
5563 # Establish context
5664 response1 = await test .send_event ("My name is Jordan and I work in finance" , timeout_seconds = 15.0 )
5765 assert_valid_agent_response (response1 )
@@ -66,7 +74,7 @@ async def test_agentic_agent_context():
6674@pytest .mark .asyncio
6775async def test_agentic_agent_timeout_handling ():
6876 """Test proper timeout configuration for different scenarios."""
69- async with test_agentic_agent () as test :
77+ async with test_agentic_agent (agent_name = AGENT_NAME ) as test :
7078 # Quick question - short timeout
7179 response = await test .send_event ("Hi!" , timeout_seconds = 10.0 )
7280 assert_valid_agent_response (response )
@@ -76,7 +84,7 @@ async def test_agentic_agent_timeout_handling():
7684@pytest .mark .asyncio
7785async def test_agentic_agent_conversation_flow ():
7886 """Test natural conversation flow with agentic agent."""
79- async with test_agentic_agent () as test :
87+ async with test_agentic_agent (agent_name = AGENT_NAME ) as test :
8088 # Simulate a natural conversation
8189 messages = [
8290 "I need help with a Python project" ,
@@ -89,7 +97,7 @@ async def test_agentic_agent_conversation_flow():
8997 response = await test .send_event (msg , timeout_seconds = 20.0 )
9098 assert_valid_agent_response (response )
9199 responses .append (response )
92- print (f"✓ Exchange { i + 1 } /3 complete" )
100+ print (f"✓ Exchange { i + 1 } /3 complete" )
93101
94102 # All exchanges should succeed
95103 assert len (responses ) == 3
0 commit comments