Files
codewhale/crates
HUQIANTAO 46134e5bb5 test(mcp): add comprehensive unit tests for MCP manager and helpers (#2441)
* test(mcp): add comprehensive unit tests for MCP manager and helpers

Add 36 unit tests covering:
- InMemoryMcpClient: tool/resource registration, listing, calling, error cases
- McpManager: start_all (ready/failed/cancelled), list_tools with filters, call_tool,
  call_qualified_tool, unregister, stop, list_resources, read_resource, sandbox state
- Tool filter: allow/deny semantics, deny-overrides-allow
- Helper functions: sanitize_component, qualify_tool_name, parse_qualified_tool_name,
  parse_server_from_uri
- JsonRpcError: code correctness, envelope formatting
- Serialization: McpServerConfig defaults, McpStartupStatus snake_case

* style: fix cargo fmt formatting

* fix(mcp): preserve truncated qualified tool calls

---------

Co-authored-by: Hu Qiantao <huqiantao@HudeMacBook-Air.local>
Co-authored-by: Hunter B <hmbown@gmail.com>
2026-05-31 11:01:20 -07:00
..