MCPcopy Create free account
hub / github.com/MiniMax-AI/Mini-Agent / test_mixed_config_loading

Function test_mixed_config_loading

tests/test_mcp.py:311–330  ·  view source on GitHub ↗

Test loading config with both STDIO and URL-based servers.

()

Source from the content-addressed store, hash-verified

309
310@pytest.mark.asyncio
311async def test_mixed_config_loading():
312 """Test loading config with both STDIO and URL-based servers."""
313 with tempfile.NamedTemporaryFile(mode="w", suffix=".json", delete=False) as f:
314 config = {
315 "mcpServers": {
316 "stdio-server": {"command": "npx", "args": ["-y", "nonexistent-server"], "disabled": True},
317 "url-server": {"url": "https://mcp.nonexistent.example.com/mcp", "disabled": True},
318 "sse-server": {"url": "https://sse.nonexistent.example.com/sse", "type": "sse", "disabled": True},
319 }
320 }
321 json.dump(config, f)
322 f.flush()
323
324 try:
325 # All servers are disabled, should return empty but not error
326 tools = await load_mcp_tools_async(f.name)
327 assert tools == []
328 finally:
329 await cleanup_mcp_connections()
330 Path(f.name).unlink()
331
332
333@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 2

load_mcp_tools_asyncFunction · 0.90
cleanup_mcp_connectionsFunction · 0.90

Tested by

no test coverage detected