conductor(checkpoint): Checkpoint end of Phase 2: Test Suite Migration

This commit is contained in:
2026-02-23 15:56:46 -05:00
parent be20d80453
commit 6677a6e55b
14 changed files with 301 additions and 580 deletions

View File

@@ -1,23 +1,23 @@
import pytest
import sys
import os
from unittest.mock import MagicMock, patch
# Ensure project root is in path
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_agent_tools_wiring():
# Only enable read_file and run_powershell
agent_tools = {
"run_powershell": True,
"read_file": True,
"list_directory": False,
"search_files": False,
"get_file_summary": False,
"web_search": False,
"fetch_url": False
}
set_agent_tools(agent_tools)
anth_tools = _build_anthropic_tools()
tool_names = [t["name"] for t in anth_tools]
assert "read_file" in tool_names
assert "run_powershell" in tool_names
assert "list_directory" not in tool_names
assert "web_search" not in tool_names
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_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'