fix(conductor): Apply review suggestions for track 'live_gui_testing_20260223'
This commit is contained in:
@@ -8,16 +8,15 @@ sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
|
||||
|
||||
from ai_client import set_agent_tools, _build_anthropic_tools
|
||||
|
||||
def test_set_agent_tools_gemini():
|
||||
with patch('ai_client._ensure_gemini_client'):
|
||||
set_agent_tools('gemini', ['read_file', 'list_directory'])
|
||||
# Implementation details check would go here
|
||||
def test_set_agent_tools():
|
||||
# Correct usage: pass a dict
|
||||
agent_tools = {"read_file": True, "list_directory": False}
|
||||
set_agent_tools(agent_tools)
|
||||
|
||||
def test_build_anthropic_tools_conversion():
|
||||
# Test that MCP tools are correctly formatted for Anthropic
|
||||
mcp_tools = [
|
||||
{"name": "test_tool", "description": "desc", "input_schema": {"type": "object", "properties": {}}}
|
||||
]
|
||||
anthropic_tools = _build_anthropic_tools(mcp_tools)
|
||||
assert len(anthropic_tools) == 1
|
||||
assert anthropic_tools[0]['name'] == 'test_tool'
|
||||
# _build_anthropic_tools takes no arguments and uses the global _agent_tools
|
||||
# We set a tool to True and check if it appears in the output
|
||||
set_agent_tools({"read_file": True})
|
||||
anthropic_tools = _build_anthropic_tools()
|
||||
tool_names = [t["name"] for t in anthropic_tools]
|
||||
assert "read_file" in tool_names
|
||||
|
||||
Reference in New Issue
Block a user