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

Function test_url_config_validation

tests/test_mcp.py:263–283  ·  view source on GitHub ↗

Test that URL-based config without url is rejected.

()

Source from the content-addressed store, hash-verified

261
262@pytest.mark.asyncio
263async def test_url_config_validation():
264 """Test that URL-based config without url is rejected."""
265 with tempfile.NamedTemporaryFile(mode="w", suffix=".json", delete=False) as f:
266 config = {
267 "mcpServers": {
268 "broken-sse": {
269 "type": "sse",
270 # Missing "url" field
271 }
272 }
273 }
274 json.dump(config, f)
275 f.flush()
276
277 try:
278 tools = await load_mcp_tools_async(f.name)
279 # Should return empty list (server skipped due to missing url)
280 assert tools == []
281 finally:
282 await cleanup_mcp_connections()
283 Path(f.name).unlink()
284
285
286@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