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

Function test_stdio_config_validation

tests/test_mcp.py:287–307  ·  view source on GitHub ↗

Test that STDIO config without command is rejected.

()

Source from the content-addressed store, hash-verified

285
286@pytest.mark.asyncio
287async def test_stdio_config_validation():
288 """Test that STDIO config without command is rejected."""
289 with tempfile.NamedTemporaryFile(mode="w", suffix=".json", delete=False) as f:
290 config = {
291 "mcpServers": {
292 "broken-stdio": {
293 "type": "stdio",
294 # Missing "command" field
295 }
296 }
297 }
298 json.dump(config, f)
299 f.flush()
300
301 try:
302 tools = await load_mcp_tools_async(f.name)
303 # Should return empty list (server skipped due to missing command)
304 assert tools == []
305 finally:
306 await cleanup_mcp_connections()
307 Path(f.name).unlink()
308
309
310@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