mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-23 20:23:00 +00:00
fix(ci): align test expectations with tool renames, fix ruff lint/format
- test_all_tools: todo→tasks, iching→zen tool name expectations - ruff: fix import sorting in test files - ruff: format server.py and batch_tool.py
This commit is contained in:
@@ -168,6 +168,7 @@ class HanzoMCPServer:
|
||||
# Set hanzo-mcp version on the low-level server (FastMCP doesn't expose this)
|
||||
try:
|
||||
from importlib.metadata import version as pkg_version
|
||||
|
||||
self.mcp._mcp_server.version = pkg_version("hanzo-mcp")
|
||||
except Exception:
|
||||
self.mcp._mcp_server.version = "0.12.5"
|
||||
|
||||
@@ -60,7 +60,9 @@ class BatchTool:
|
||||
|
||||
tool = self.tools.get(tool_name)
|
||||
if tool is None:
|
||||
return _BatchResult(index, tool_name, f"Error: Tool '{tool_name}' not found")
|
||||
return _BatchResult(
|
||||
index, tool_name, f"Error: Tool '{tool_name}' not found"
|
||||
)
|
||||
|
||||
async with semaphore:
|
||||
try:
|
||||
@@ -74,7 +76,9 @@ class BatchTool:
|
||||
|
||||
return _BatchResult(index, tool_name, str(result))
|
||||
|
||||
tasks = [_run(i, invocation) for i, invocation in enumerate(invocations, start=1)]
|
||||
tasks = [
|
||||
_run(i, invocation) for i, invocation in enumerate(invocations, start=1)
|
||||
]
|
||||
results = await asyncio.gather(*tasks)
|
||||
results.sort(key=lambda item: item.index)
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ from unittest.mock import Mock
|
||||
import pytest
|
||||
from hanzo_tools.agent import TOOLS, register_tools
|
||||
from hanzo_tools.agent.agent_tool import AgentTool
|
||||
from hanzo_tools.agent.zen_tool import ZenTool
|
||||
from hanzo_tools.agent.review_tool import ReviewTool
|
||||
from hanzo_tools.agent.zen_tool import ZenTool
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
@@ -13,6 +13,7 @@ from pathlib import Path
|
||||
sys.path.insert(0, str(Path(__file__).parent.parent))
|
||||
|
||||
import pytest
|
||||
|
||||
from hanzo_mcp import __version__
|
||||
from hanzo_mcp.server import create_server
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ class TestToolPackages:
|
||||
from hanzo_tools.todo import TOOLS
|
||||
|
||||
assert len(TOOLS) == 1
|
||||
assert TOOLS[0].name == "todo"
|
||||
assert TOOLS[0].name == "tasks"
|
||||
|
||||
def test_reasoning_tools(self):
|
||||
"""Test hanzo-tools-reasoning has 2 tools."""
|
||||
@@ -94,13 +94,13 @@ class TestToolPackages:
|
||||
def test_agent_tools(self):
|
||||
"""Test hanzo-tools-agent has 3 tools.
|
||||
|
||||
Core tools: AgentTool, IChingTool, ReviewTool
|
||||
Core tools: AgentTool, ZenTool, ReviewTool
|
||||
"""
|
||||
from hanzo_tools.agent import TOOLS
|
||||
|
||||
assert len(TOOLS) == 3, f"Expected 3 agent tools, got {len(TOOLS)}"
|
||||
names = {t.name for t in TOOLS}
|
||||
assert names == {"agent", "iching", "review"}
|
||||
assert names == {"agent", "zen", "review"}
|
||||
|
||||
def test_jupyter_tools(self):
|
||||
"""Test hanzo-tools-jupyter has 1 tool."""
|
||||
|
||||
Reference in New Issue
Block a user