Skip to content

Commit 419151d

Browse files
jquinterclaude
andcommitted
fix(tests): resolve merge conflict in test_vertex_ai_rerank_transformation.py
The file had two unresolved git merge conflict markers from a merge of litellm_oss_staging_02_17_2026 into main, causing a SyntaxError when pytest tried to collect the test module. Kept the instance-level mocking approach (from litellm_oss_staging) for test_get_complete_url and test_validate_environment, which is consistent with the rest of the file and avoids class-reference issues caused by importlib.reload(litellm) in conftest.py. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 65a79d5 commit 419151d

File tree

1 file changed

+0
-45
lines changed

1 file changed

+0
-45
lines changed

tests/test_litellm/llms/vertex_ai/rerank/test_vertex_ai_rerank_transformation.py

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def teardown_method(self):
4141
for var, value in self._saved_env.items():
4242
os.environ[var] = value
4343

44-
<<<<<<< litellm_oss_staging_02_17_2026
4544
def test_get_complete_url(self):
4645
"""
4746
Test URL generation for Vertex AI Discovery Engine rerank API.
@@ -52,19 +51,6 @@ def test_get_complete_url(self):
5251
# Mock _ensure_access_token at instance level to return (token, project_id)
5352
mock_ensure_access_token = MagicMock(return_value=("mock-token", None))
5453
self.config._ensure_access_token = mock_ensure_access_token
55-
=======
56-
@patch('litellm.llms.vertex_ai.rerank.transformation.get_secret_str')
57-
@patch('litellm.llms.vertex_ai.rerank.transformation.VertexAIRerankConfig._ensure_access_token')
58-
def test_get_complete_url(self, mock_ensure_access_token, mock_get_secret_str):
59-
"""Test URL generation for Vertex AI Discovery Engine rerank API."""
60-
# Mock _ensure_access_token to return (token, project_id)
61-
mock_ensure_access_token.return_value = ("mock-token", None)
62-
63-
# Mock get_secret_str to return the environment variable value
64-
def mock_get_secret(key):
65-
return os.environ.get(key)
66-
mock_get_secret_str.side_effect = mock_get_secret
67-
>>>>>>> main
6854

6955
# Test with project ID from environment
7056
with patch.dict(os.environ, {"VERTEXAI_PROJECT": "test-project-123"}):
@@ -109,7 +95,6 @@ def mock_get_secret(key):
10995
finally:
11096
litellm.vertex_project = original_project
11197

112-
<<<<<<< litellm_oss_staging_02_17_2026
11398
def test_validate_environment(self):
11499
"""
115100
Test environment validation and header setup.
@@ -135,36 +120,6 @@ def test_validate_environment(self):
135120
"X-Goog-User-Project": "test-project-123"
136121
}
137122
assert headers == expected_headers
138-
=======
139-
@patch('litellm.llms.vertex_ai.rerank.transformation.get_secret_str')
140-
@patch('litellm.llms.vertex_ai.rerank.transformation.VertexAIRerankConfig._ensure_access_token')
141-
def test_validate_environment(self, mock_ensure_access_token, mock_get_secret_str):
142-
"""Test environment validation and header setup."""
143-
# Mock the authentication
144-
mock_ensure_access_token.return_value = ("test-access-token", "test-project-123")
145-
146-
# Mock get_secret_str to return the environment variable value
147-
def mock_get_secret(key):
148-
return os.environ.get(key)
149-
mock_get_secret_str.side_effect = mock_get_secret
150-
151-
# Mock the credential and project methods
152-
with patch.object(self.config, 'get_vertex_ai_credentials', return_value=None), \
153-
patch.object(self.config, 'get_vertex_ai_project', return_value="test-project-123"):
154-
155-
headers = self.config.validate_environment(
156-
headers={},
157-
model=self.model,
158-
api_key=None
159-
)
160-
161-
expected_headers = {
162-
"Authorization": "Bearer test-access-token",
163-
"Content-Type": "application/json",
164-
"X-Goog-User-Project": "test-project-123"
165-
}
166-
assert headers == expected_headers
167-
>>>>>>> main
168123

169124
def test_transform_rerank_request_basic(self):
170125
"""Test basic request transformation for Vertex AI Discovery Engine format."""

0 commit comments

Comments
 (0)