(
agent_runner: TestRunner,
function_name: str,
params,
expected=None,
exception: Exception = None,
)
| 248 | |
| 249 | |
| 250 | def _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 | |
| 271 | def _assert_raises(agent_runner: TestRunner, query: str, exception: Exception): |
no test coverage detected