From 4f4edea055f81147793fcbbfbde371381e93983f Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Sat, 22 Aug 2026 10:27:32 -0700 Subject: [PATCH] test(files): update the managed-files test doubles to the current afile_list Eleven DummyManagedFiles stubs still declared afile_list(self, purpose, litellm_parent_otel_span). The real hook grew user_api_key_dict, limit and after, so the doubles no longer stand in for the interface they replace. Their tests pass today only because every one of them takes a provider branch that never reaches the hook, which means a stub going stale is invisible until some later test does reach it and reads a TypeError as a behavior change. Signatures only; no test changes behavior. --- .../test_files_endpoint.py | 110 ++++++++++++++++-- 1 file changed, 99 insertions(+), 11 deletions(-) diff --git a/tests/test_litellm/proxy/openai_files_endpoint/test_files_endpoint.py b/tests/test_litellm/proxy/openai_files_endpoint/test_files_endpoint.py index 3df7a6643cd..c15ba5bcedb 100644 --- a/tests/test_litellm/proxy/openai_files_endpoint/test_files_endpoint.py +++ b/tests/test_litellm/proxy/openai_files_endpoint/test_files_endpoint.py @@ -329,7 +329,15 @@ def test_mock_create_audio_file(mocker: MockerFixture, monkeypatch, llm_router: async def afile_retrieve(self, file_id, litellm_parent_otel_span, llm_router): raise NotImplementedError("Not implemented for test") - async def afile_list(self, purpose, litellm_parent_otel_span): + async def afile_list( + self, + purpose, + litellm_parent_otel_span, + user_api_key_dict, + limit=None, + after=None, + **data, + ): raise NotImplementedError("Not implemented for test") async def afile_delete( @@ -903,7 +911,15 @@ def test_create_file_with_expires_after( async def afile_retrieve(self, file_id, litellm_parent_otel_span, llm_router): raise NotImplementedError("Not implemented for test") - async def afile_list(self, purpose, litellm_parent_otel_span): + async def afile_list( + self, + purpose, + litellm_parent_otel_span, + user_api_key_dict, + limit=None, + after=None, + **data, + ): raise NotImplementedError("Not implemented for test") async def afile_delete( @@ -1066,7 +1082,15 @@ def test_create_file_with_expires_after_valid_values( async def afile_retrieve(self, file_id, litellm_parent_otel_span, llm_router): raise NotImplementedError("Not implemented for test") - async def afile_list(self, purpose, litellm_parent_otel_span): + async def afile_list( + self, + purpose, + litellm_parent_otel_span, + user_api_key_dict, + limit=None, + after=None, + **data, + ): raise NotImplementedError("Not implemented for test") async def afile_delete( @@ -1154,7 +1178,15 @@ def test_create_file_without_expires_after( async def afile_retrieve(self, file_id, litellm_parent_otel_span, llm_router): raise NotImplementedError("Not implemented for test") - async def afile_list(self, purpose, litellm_parent_otel_span): + async def afile_list( + self, + purpose, + litellm_parent_otel_span, + user_api_key_dict, + limit=None, + after=None, + **data, + ): raise NotImplementedError("Not implemented for test") async def afile_delete( @@ -1251,7 +1283,15 @@ def test_managed_files_with_loadbalancing( async def afile_retrieve(self, file_id, litellm_parent_otel_span, llm_router): raise NotImplementedError("Not implemented for test") - async def afile_list(self, purpose, litellm_parent_otel_span): + async def afile_list( + self, + purpose, + litellm_parent_otel_span, + user_api_key_dict, + limit=None, + after=None, + **data, + ): raise NotImplementedError("Not implemented for test") async def afile_delete( @@ -1368,7 +1408,15 @@ def test_create_file_with_nested_litellm_metadata( async def afile_retrieve(self, file_id, litellm_parent_otel_span, llm_router): raise NotImplementedError("Not implemented for test") - async def afile_list(self, purpose, litellm_parent_otel_span): + async def afile_list( + self, + purpose, + litellm_parent_otel_span, + user_api_key_dict, + limit=None, + after=None, + **data, + ): raise NotImplementedError("Not implemented for test") async def afile_delete( @@ -1472,7 +1520,15 @@ def test_create_file_with_deep_nested_litellm_metadata( async def afile_retrieve(self, file_id, litellm_parent_otel_span, llm_router): raise NotImplementedError("Not implemented for test") - async def afile_list(self, purpose, litellm_parent_otel_span): + async def afile_list( + self, + purpose, + litellm_parent_otel_span, + user_api_key_dict, + limit=None, + after=None, + **data, + ): raise NotImplementedError("Not implemented for test") async def afile_delete( @@ -1568,7 +1624,15 @@ def _make_capturing_managed_files(): async def afile_retrieve(self, file_id, litellm_parent_otel_span, llm_router): raise NotImplementedError - async def afile_list(self, purpose, litellm_parent_otel_span): + async def afile_list( + self, + purpose, + litellm_parent_otel_span, + user_api_key_dict, + limit=None, + after=None, + **data, + ): raise NotImplementedError async def afile_delete( @@ -2051,7 +2115,15 @@ def test_require_managed_files_allows_managed_file_upload( async def afile_retrieve(self, file_id, litellm_parent_otel_span, llm_router): raise NotImplementedError - async def afile_list(self, purpose, litellm_parent_otel_span): + async def afile_list( + self, + purpose, + litellm_parent_otel_span, + user_api_key_dict, + limit=None, + after=None, + **data, + ): raise NotImplementedError async def afile_delete( @@ -2175,7 +2247,15 @@ def test_require_managed_files_accepts_target_model_names_bracket_form( async def afile_retrieve(self, file_id, litellm_parent_otel_span, llm_router): raise NotImplementedError - async def afile_list(self, purpose, litellm_parent_otel_span): + async def afile_list( + self, + purpose, + litellm_parent_otel_span, + user_api_key_dict, + limit=None, + after=None, + **data, + ): raise NotImplementedError async def afile_delete( @@ -2255,7 +2335,15 @@ def test_require_managed_files_accepts_repeated_target_model_names_bracket_form( async def afile_retrieve(self, file_id, litellm_parent_otel_span, llm_router): raise NotImplementedError - async def afile_list(self, purpose, litellm_parent_otel_span): + async def afile_list( + self, + purpose, + litellm_parent_otel_span, + user_api_key_dict, + limit=None, + after=None, + **data, + ): raise NotImplementedError async def afile_delete(