MCPcopy
hub / github.com/urllib3/urllib3 / test_connection_timeouts

Method test_connection_timeouts

test/contrib/test_socks.py:349–362  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

347 assert response.status == 200
348
349 def test_connection_timeouts(self) -> None:
350 event = threading.Event()
351
352 def request_handler(listener: socket.socket) -> None:
353 event.wait()
354
355 self._start_server(request_handler)
356 proxy_url = f"socks5h://{self.host}:{self.port}"
357 with socks.SOCKSProxyManager(proxy_url) as pm:
358 with pytest.raises(ConnectTimeoutError):
359 pm.request(
360 "GET", "http://example.com", timeout=SHORT_TIMEOUT, retries=False
361 )
362 event.set()
363
364 @patch("socks.create_connection")
365 def test_socket_timeout(self, create_connection: Mock) -> None:

Callers

nothing calls this directly

Calls 2

_start_serverMethod · 0.45
requestMethod · 0.45

Tested by

no test coverage detected