Test loading config with both STDIO and URL-based servers.
()
| 309 | |
| 310 | @pytest.mark.asyncio |
| 311 | async 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 |
nothing calls this directly
no test coverage detected