From d18190ed16852b572f2be5438302ae2f991cccc9 Mon Sep 17 00:00:00 2001 From: harish876 Date: Tue, 7 Apr 2026 19:08:03 +0000 Subject: [PATCH] test case to check if request params are stripped or sanitized when build request is called. --- .../files/test_vertex_ai_files_transformation.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/test_litellm/llms/vertex_ai/files/test_vertex_ai_files_transformation.py b/tests/test_litellm/llms/vertex_ai/files/test_vertex_ai_files_transformation.py index 598ad255aca..7922903b457 100644 --- a/tests/test_litellm/llms/vertex_ai/files/test_vertex_ai_files_transformation.py +++ b/tests/test_litellm/llms/vertex_ai/files/test_vertex_ai_files_transformation.py @@ -136,6 +136,22 @@ class TestTransformFileContent: assert isinstance(result, HttpxBinaryResponseContent) assert result.response.content == b'{"line": 1}\n{"line": 2}\n' + def test_should_preserve_alt_media_query_when_build_request_has_no_params(self, config): + file_id = "gs://my-bucket/path/to/file.jsonl" + url, params = config.transform_file_content_request( + file_content_request={"file_id": file_id}, + optional_params={}, + litellm_params={}, + ) + + assert params == {} + + client = httpx.Client() + request = client.build_request("GET", url, headers={}) + + assert str(request.url) == url + assert request.url.params.get("alt") == "media" + class TestTransformDeleteFile: def test_should_build_correct_gcs_delete_url(self, config):