MCPcopy Index your code
hub / github.com/google/adk-python / assert_agent_says_in_order

Function assert_agent_says_in_order

tests/integration/utils/asserts.py:38–54  ·  view source on GitHub ↗
(
    expected_conversation: list[Message], agent_runner: TestRunner
)

Source from the content-addressed store, hash-verified

36
37
38def assert_agent_says_in_order(
39 expected_conversation: list[Message], agent_runner: TestRunner
40):
41 expected_conversation_idx = len(expected_conversation) - 1
42 for event in reversed(agent_runner.get_events()):
43 if event.content.parts and event.content.parts[0].text:
44 assert (
45 event.author
46 == expected_conversation[expected_conversation_idx]['agent_name']
47 )
48 assert (
49 event.content.parts[0].text.strip()
50 == expected_conversation[expected_conversation_idx]['expected_text']
51 )
52 expected_conversation_idx -= 1
53 if expected_conversation_idx < 0:
54 return
55
56
57def assert_agent_transfer_path(

Callers

nothing calls this directly

Calls 2

get_eventsMethod · 0.80
stripMethod · 0.80

Tested by

no test coverage detected