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

Function test_no_args_function

tests/test_function_schema.py:20–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18
19
20def test_no_args_function():
21 func_schema = function_schema(no_args_function)
22 assert func_schema.params_json_schema.get("title") == "no_args_function_args"
23 assert func_schema.description == "This function has no args."
24 assert not func_schema.takes_context
25
26 parsed = func_schema.params_pydantic_model()
27 args, kwargs_dict = func_schema.to_call_args(parsed)
28 result = no_args_function(*args, **kwargs_dict)
29 assert result == "ok"
30
31
32def no_args_function_with_context(ctx: RunContextWrapper[str]):

Callers

nothing calls this directly

Calls 4

function_schemaFunction · 0.90
no_args_functionFunction · 0.85
to_call_argsMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected