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

Class TestMCPServerConnectionTimeout

tests/test_mcp.py:222–254  ·  view source on GitHub ↗

Tests for MCPServerConnection timeout behavior.

Source from the content-addressed store, hash-verified

220
221
222class TestMCPServerConnectionTimeout:
223 """Tests for MCPServerConnection timeout behavior."""
224
225 def test_get_effective_connect_timeout_with_override(self):
226 """Test getting effective connect timeout with per-server override."""
227 conn = MCPServerConnection(
228 name="test",
229 connection_type="sse",
230 url="https://example.com",
231 connect_timeout=20.0,
232 )
233 assert conn._get_connect_timeout() == 20.0
234
235 def test_get_effective_connect_timeout_without_override(self):
236 """Test getting effective connect timeout using global default."""
237 conn = MCPServerConnection(
238 name="test",
239 connection_type="sse",
240 url="https://example.com",
241 )
242 # Should use global default
243 global_config = get_mcp_timeout_config()
244 assert conn._get_connect_timeout() == global_config.connect_timeout
245
246 def test_get_effective_execute_timeout_with_override(self):
247 """Test getting effective execute timeout with per-server override."""
248 conn = MCPServerConnection(
249 name="test",
250 connection_type="sse",
251 url="https://example.com",
252 execute_timeout=180.0,
253 )
254 assert conn._get_execute_timeout() == 180.0
255
256
257# =============================================================================

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected