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

Function assert_agent_transfer_path

tests/integration/utils/asserts.py:57–75  ·  view source on GitHub ↗
(
    expected_path: list[str], *, agent_runner: TestRunner
)

Source from the content-addressed store, hash-verified

55
56
57def assert_agent_transfer_path(
58 expected_path: list[str], *, agent_runner: TestRunner
59):
60 events = agent_runner.get_events()
61 idx_in_expected_path = len(expected_path) - 1
62 # iterate events in reverse order
63 for event in reversed(events):
64 function_calls = event.get_function_calls()
65 if (
66 len(function_calls) == 1
67 and function_calls[0].name == 'transfer_to_agent'
68 ):
69 assert (
70 function_calls[0].args['agent_name']
71 == expected_path[idx_in_expected_path]
72 )
73 idx_in_expected_path -= 1
74 if idx_in_expected_path < 0:
75 return

Callers

nothing calls this directly

Calls 2

get_eventsMethod · 0.80
get_function_callsMethod · 0.80

Tested by

no test coverage detected