MCPcopy Create free account
hub / github.com/openai/openai-agents-python / test_tool_name_properties

Function test_tool_name_properties

tests/test_tool_metadata.py:36–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34
35
36def test_tool_name_properties() -> None:
37 dummy_computer = cast(Computer, object())
38 dummy_mcp = cast(Mcp, {"type": "mcp", "server_label": "demo"})
39 dummy_code = cast(CodeInterpreter, {"type": "code_interpreter", "container": "python"})
40 dummy_image = cast(ImageGeneration, {"type": "image_generation", "model": "gpt-image-1"})
41
42 assert FileSearchTool(vector_store_ids=[]).name == "file_search"
43 assert WebSearchTool().name == "web_search"
44 assert ComputerTool(computer=dummy_computer).name == "computer_use_preview"
45 assert ComputerTool(computer=dummy_computer).trace_name == "computer"
46 assert HostedMCPTool(tool_config=dummy_mcp).name == "hosted_mcp"
47 assert CodeInterpreterTool(tool_config=dummy_code).name == "code_interpreter"
48 assert ImageGenerationTool(tool_config=dummy_image).name == "image_generation"
49 assert LocalShellTool(executor=lambda req: "ok").name == "local_shell"
50 shell_tool = ShellTool(executor=lambda req: "ok")
51 assert shell_tool.type == "shell"
52 assert shell_tool.environment == {"type": "local"}
53 assert ApplyPatchTool(editor=DummyEditor()).type == "apply_patch"
54
55
56def test_shell_command_output_status_property() -> None:

Callers

nothing calls this directly

Calls 10

FileSearchToolClass · 0.90
WebSearchToolClass · 0.90
ComputerToolClass · 0.90
HostedMCPToolClass · 0.90
CodeInterpreterToolClass · 0.90
ImageGenerationToolClass · 0.90
LocalShellToolClass · 0.90
ShellToolClass · 0.90
ApplyPatchToolClass · 0.90
DummyEditorClass · 0.70

Tested by

no test coverage detected