From 6f67aacab372100cd0017a66446f77cd8db8b643 Mon Sep 17 00:00:00 2001 From: Chester Curme <chester.curme@gmail.com> Date: Sat, 22 Feb 2025 09:28:45 -0500 Subject: [PATCH] add test --- .../tests/integration_tests/chat_models/test_base.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libs/partners/openai/tests/integration_tests/chat_models/test_base.py b/libs/partners/openai/tests/integration_tests/chat_models/test_base.py index 09cae79520b..2568938fec5 100644 --- a/libs/partners/openai/tests/integration_tests/chat_models/test_base.py +++ b/libs/partners/openai/tests/integration_tests/chat_models/test_base.py @@ -676,6 +676,16 @@ def test_openai_proxy() -> None: assert proxy.host == b"localhost" assert proxy.port == 8080 + http_async_client = httpx.AsyncClient(proxy="http://localhost:8081") + chat_openai = ChatOpenAI(http_async_client=http_async_client) + mounts = chat_openai.async_client._client._client._mounts + assert len(mounts) == 1 + for key, value in mounts.items(): + proxy = value._pool._proxy_url.origin + assert proxy.scheme == b"http" + assert proxy.host == b"localhost" + assert proxy.port == 8081 + def test_openai_response_headers() -> None: """Test ChatOpenAI response headers."""