(self, capsys: pytest.CaptureFixture[str])
| 1488 | ) |
| 1489 | |
| 1490 | def test_debuglevel(self, capsys: pytest.CaptureFixture[str]) -> None: |
| 1491 | def http_socket_handler(listener: socket.socket) -> None: |
| 1492 | sock = listener.accept()[0] |
| 1493 | consume_socket(sock) |
| 1494 | sock.send(b"HTTP/1.0 200 OK\r\nExample-Header: Example-Value\r\n\r\n") |
| 1495 | sock.close() |
| 1496 | |
| 1497 | self._start_server(http_socket_handler) |
| 1498 | base_url = f"http://{self.host}:{self.port}" |
| 1499 | |
| 1500 | with mock.patch("http.client.HTTPConnection.debuglevel", 1): |
| 1501 | with ProxyManager(base_url) as proxy: |
| 1502 | with pytest.raises(MaxRetryError): |
| 1503 | proxy.request("GET", "https://example.com", retries=0) |
| 1504 | |
| 1505 | assert "header: Example-Header: Example-Value\r\n\n" in capsys.readouterr().out |
| 1506 | |
| 1507 | |
| 1508 | class TestSSL(SocketDummyServerTestCase): |
nothing calls this directly
no test coverage detected