Test loading MCP tools from mcp.json.
()
| 332 | |
| 333 | @pytest.mark.asyncio |
| 334 | async def test_mcp_tools_loading(): |
| 335 | """Test loading MCP tools from mcp.json.""" |
| 336 | print("\n=== Testing MCP Tool Loading ===") |
| 337 | |
| 338 | try: |
| 339 | # Load MCP tools |
| 340 | tools = await load_mcp_tools_async("mini_agent/config/mcp.json") |
| 341 | |
| 342 | print(f"Loaded {len(tools)} MCP tools") |
| 343 | |
| 344 | # Display loaded tools |
| 345 | if tools: |
| 346 | for tool in tools: |
| 347 | desc = tool.description[:60] if len(tool.description) > 60 else tool.description |
| 348 | print(f" - {tool.name}: {desc}") |
| 349 | |
| 350 | # Test should pass even if no tools loaded (e.g., no mcp.json or no Node.js) |
| 351 | assert isinstance(tools, list), "Should return a list of tools" |
| 352 | print("✅ MCP tools loading test passed") |
| 353 | |
| 354 | finally: |
| 355 | # Cleanup MCP connections |
| 356 | await cleanup_mcp_connections() |
| 357 | |
| 358 | |
| 359 | @pytest.mark.asyncio |
no test coverage detected