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

Function _call_function_and_assert

tests/integration/test_tools.py:250–268  ·  view source on GitHub ↗
(
    agent_runner: TestRunner,
    function_name: str,
    params,
    expected=None,
    exception: Exception = None,
)

Source from the content-addressed store, hash-verified

248
249
250def _call_function_and_assert(
251 agent_runner: TestRunner,
252 function_name: str,
253 params,
254 expected=None,
255 exception: Exception = None,
256):
257 param_section = (
258 " with params"
259 f" {params if isinstance(params, str) else json.dumps(params)}"
260 if params is not None
261 else ""
262 )
263 query = f"Call {function_name}{param_section} and show me the result"
264 if exception:
265 _assert_raises(agent_runner, query, exception)
266 return
267
268 _assert_function_output(agent_runner, query, expected)
269
270
271def _assert_raises(agent_runner: TestRunner, query: str, exception: Exception):

Calls 2

_assert_raisesFunction · 0.85
_assert_function_outputFunction · 0.85

Tested by

no test coverage detected