MCPcopy
hub / github.com/openai/openai-agents-python / assert_step_output

Function assert_step_output

tests/test_hitl_session_scenario.py:318–336  ·  view source on GitHub ↗
(
    items: list[TResponseInputItem],
    approval_item: Any,
    step: ScenarioStep,
)

Source from the content-addressed store, hash-verified

316
317
318def assert_step_output(
319 items: list[TResponseInputItem],
320 approval_item: Any,
321 step: ScenarioStep,
322) -> None:
323 last_user = get_last_user_text(items)
324 assert last_user == step.message
325
326 last_call = find_last_function_call(items)
327 last_result = find_last_function_output(items)
328
329 approval_call_id = extract_call_id(approval_item.raw_item)
330 assert last_call is not None
331 assert last_call.get("name") == step.tool_name
332 assert last_call.get("call_id") == approval_call_id
333
334 assert last_result is not None
335 assert last_result.get("call_id") == approval_call_id
336 assert extract_output_text(last_result) == step.expected_output
337
338
339def assert_step_items(

Callers 1

Calls 6

get_last_user_textFunction · 0.85
find_last_function_callFunction · 0.85
extract_output_textFunction · 0.85
extract_call_idFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected