MCPcopy Create free account
hub / github.com/CJackHwang/AIstudioProxyAPI / test_handle_client_connect

Function test_handle_client_connect

tests/api_utils/test_stream.py:37–49  ·  view source on GitHub ↗
(proxy_server)

Source from the content-addressed store, hash-verified

35
36@pytest.mark.asyncio
37async 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

Callers

nothing calls this directly

Calls 1

handle_clientMethod · 0.80

Tested by

no test coverage detected