(proxy_server)
| 35 | |
| 36 | @pytest.mark.asyncio |
| 37 | async def test_handle_client_connect(proxy_server): |
| 38 | reader = AsyncMock() |
| 39 | writer = AsyncMock() |
| 40 | |
| 41 | reader.readline.return_value = b"CONNECT api.test.com:443 HTTP/1.1\r\n" |
| 42 | |
| 43 | with patch.object(proxy_server, "_handle_connect", AsyncMock()) as mock_handle: |
| 44 | await proxy_server.handle_client(reader, writer) |
| 45 | mock_handle.assert_called_once() |
| 46 | args = mock_handle.call_args[0] |
| 47 | assert args[2] == "api.test.com:443" |
| 48 | |
| 49 | writer.close.assert_called_once() |
| 50 | |
| 51 | |
| 52 | @pytest.mark.asyncio |
nothing calls this directly
no test coverage detected