Files
python-sdk/pkg/hanzo-mcp/tests/test_memory_utils.py
T
zeekay 7ff34ba5bf feat(hanzo-tools): v0.10.17 - modular tool packages + computer control
- Add hanzo-tools-computer package for pyautogui Mac automation
- Fix hanzo-tools-agent imports to use new package structure
- Add get_read_only_*_tools() helpers to filesystem/jupyter
- Remove BatchTool (replaced by dag - one tool per capability)
- Remove hanzo-persona dependency (not published yet)
- Simplify pyproject.toml for local development

Packages ready for PyPI:
- hanzo-tools-core
- hanzo-tools-filesystem
- hanzo-tools-shell
- hanzo-tools-browser
- hanzo-tools-memory
- hanzo-tools-todo
- hanzo-tools-reasoning
- hanzo-tools-lsp
- hanzo-tools-refactor
- hanzo-tools-database
- hanzo-tools-agent
- hanzo-tools-jupyter
- hanzo-tools-editor
- hanzo-tools-computer (NEW)
2025-12-26 06:37:28 -08:00

29 lines
918 B
Python

"""Test utilities specific to memory tests."""
from unittest.mock import Mock, AsyncMock, patch
from hanzo_mcp.tools.common.context import ToolContext
def create_memory_mock_ctx():
"""Create a mock context that works with memory tools."""
mock_ctx = Mock()
mock_ctx.request_id = "test-request-id"
mock_ctx.client_id = "test-client-id"
# Create a mock that returns a proper tool context
mock_tool_ctx = Mock(spec=ToolContext)
mock_tool_ctx.set_tool_info = AsyncMock()
mock_tool_ctx.info = AsyncMock()
mock_tool_ctx.debug = AsyncMock()
mock_tool_ctx.warning = AsyncMock()
mock_tool_ctx.error = AsyncMock()
mock_tool_ctx.send_completion_ping = AsyncMock()
# Patch create_tool_context to return our mock
with patch(
"hanzo_tools.memory.memory_tools.create_tool_context",
return_value=mock_tool_ctx,
):
yield mock_ctx, mock_tool_ctx