Skip to content

Commit 2d9f28c

Browse files
committed
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
1 parent 2f67618 commit 2d9f28c

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

pkg/hanzo-mcp/hanzo_mcp/server.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ def __init__(
168168
# Set hanzo-mcp version on the low-level server (FastMCP doesn't expose this)
169169
try:
170170
from importlib.metadata import version as pkg_version
171+
171172
self.mcp._mcp_server.version = pkg_version("hanzo-mcp")
172173
except Exception:
173174
self.mcp._mcp_server.version = "0.12.5"

pkg/hanzo-mcp/hanzo_mcp/tools/common/batch_tool.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ async def _run(index: int, invocation: dict[str, Any]) -> _BatchResult:
6060

6161
tool = self.tools.get(tool_name)
6262
if tool is None:
63-
return _BatchResult(index, tool_name, f"Error: Tool '{tool_name}' not found")
63+
return _BatchResult(
64+
index, tool_name, f"Error: Tool '{tool_name}' not found"
65+
)
6466

6567
async with semaphore:
6668
try:
@@ -74,7 +76,9 @@ async def _run(index: int, invocation: dict[str, Any]) -> _BatchResult:
7476

7577
return _BatchResult(index, tool_name, str(result))
7678

77-
tasks = [_run(i, invocation) for i, invocation in enumerate(invocations, start=1)]
79+
tasks = [
80+
_run(i, invocation) for i, invocation in enumerate(invocations, start=1)
81+
]
7882
results = await asyncio.gather(*tasks)
7983
results.sort(key=lambda item: item.index)
8084

pkg/hanzo-mcp/tests/test_agent_tools_ci.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import pytest
66
from hanzo_tools.agent import TOOLS, register_tools
77
from hanzo_tools.agent.agent_tool import AgentTool
8-
from hanzo_tools.agent.zen_tool import ZenTool
98
from hanzo_tools.agent.review_tool import ReviewTool
9+
from hanzo_tools.agent.zen_tool import ZenTool
1010

1111

1212
@pytest.fixture

pkg/hanzo-mcp/tests/test_hanzo_mcp_local.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
sys.path.insert(0, str(Path(__file__).parent.parent))
1414

1515
import pytest
16+
1617
from hanzo_mcp import __version__
1718
from hanzo_mcp.server import create_server
1819

pkg/hanzo-tools-core/tests/test_all_tools.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def test_todo_tools(self):
5757
from hanzo_tools.todo import TOOLS
5858

5959
assert len(TOOLS) == 1
60-
assert TOOLS[0].name == "todo"
60+
assert TOOLS[0].name == "tasks"
6161

6262
def test_reasoning_tools(self):
6363
"""Test hanzo-tools-reasoning has 2 tools."""
@@ -94,13 +94,13 @@ def test_database_tools(self):
9494
def test_agent_tools(self):
9595
"""Test hanzo-tools-agent has 3 tools.
9696
97-
Core tools: AgentTool, IChingTool, ReviewTool
97+
Core tools: AgentTool, ZenTool, ReviewTool
9898
"""
9999
from hanzo_tools.agent import TOOLS
100100

101101
assert len(TOOLS) == 3, f"Expected 3 agent tools, got {len(TOOLS)}"
102102
names = {t.name for t in TOOLS}
103-
assert names == {"agent", "iching", "review"}
103+
assert names == {"agent", "zen", "review"}
104104

105105
def test_jupyter_tools(self):
106106
"""Test hanzo-tools-jupyter has 1 tool."""

0 commit comments

Comments
 (0)