From 5adb7e29b9af57ec0d2fcf8a81c27558eaf51169 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Sat, 17 Aug 2024 17:42:51 -0700 Subject: [PATCH] fix test pass through --- litellm/tests/test_pass_through_endpoints.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/litellm/tests/test_pass_through_endpoints.py b/litellm/tests/test_pass_through_endpoints.py index d78a40d378..69869fe0e5 100644 --- a/litellm/tests/test_pass_through_endpoints.py +++ b/litellm/tests/test_pass_through_endpoints.py @@ -11,6 +11,7 @@ sys.path.insert( ) # Adds-the parent directory to the system path import asyncio +from unittest.mock import Mock import httpx @@ -19,7 +20,9 @@ from litellm.proxy.proxy_server import app, initialize_pass_through_endpoints # Mock the async_client used in the pass_through_request function async def mock_request(*args, **kwargs): - return httpx.Response(200, json={"message": "Mocked response"}) + mock_response = httpx.Response(200, json={"message": "Mocked response"}) + mock_response.request = Mock(spec=httpx.Request) + return mock_response @pytest.fixture