24 lines
849 B
Python
24 lines
849 B
Python
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_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'
|