diff --git a/tests/test_litellm/google_genai/test_google_genai_adapter.py b/tests/test_litellm/google_genai/test_google_genai_adapter.py index 626692cf47..e8882a1acb 100644 --- a/tests/test_litellm/google_genai/test_google_genai_adapter.py +++ b/tests/test_litellm/google_genai/test_google_genai_adapter.py @@ -1091,7 +1091,7 @@ async def test_google_generate_content_with_openai(): ) # Use AsyncMock for proper async function mocking - with unittest.mock.patch("litellm.completion", new_callable=unittest.mock.MagicMock) as mock_completion: + with unittest.mock.patch("litellm.acompletion", new_callable=unittest.mock.AsyncMock) as mock_completion: # Set the return value directly on the MagicMock mock_completion.return_value = mock_response @@ -1100,7 +1100,7 @@ async def test_google_generate_content_with_openai(): contents=[ {"role": "user", "parts": [{"text": "Hello, world!"}]} ], - systemInstruction="You are a helpful assistant.", + systemInstruction={"parts": [{"text": "You are a helpful assistant."}]}, safetySettings=[ { "category": "HARM_CATEGORY_HATE_SPEECH", @@ -1199,4 +1199,4 @@ async def test_agenerate_content_x_goog_api_key_header(): assert headers.get("Content-Type") == "application/json", f"Expected Content-Type application/json, got {headers.get('Content-Type')}" print(f"✓ Test passed: x-goog-api-key header correctly set to {api_key_value}") - print(f"✓ All headers: {list(headers.keys())}") \ No newline at end of file + print(f"✓ All headers: {list(headers.keys())}")