litellm/tests/unit/proxy/common_utils/test_swagger_utils.py
devin-ai-integration[bot] a76b59db9f
test(proxy): move middleware, spend_tracking, pass_through, common_utils and root proxy tests into tests/unit/proxy (#44015)
Co-authored-by: yuneng <yuneng@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-01 18:23:31 +00:00

18 lines
658 B
Python

import inspect
from litellm.exceptions import RateLimitError
from litellm.proxy.common_utils.swagger_utils import ERROR_RESPONSES, _error_description
class _ChildWithoutDoc(RateLimitError):
pass
def test_error_response_descriptions_carry_no_docstring_indentation():
assert ERROR_RESPONSES[429]["description"] == inspect.cleandoc(RateLimitError.__doc__ or "")
for response in ERROR_RESPONSES.values():
assert response["description"] == inspect.cleandoc(response["description"])
def test_error_description_falls_back_to_the_class_name_without_an_own_docstring():
assert _error_description(_ChildWithoutDoc) == "_ChildWithoutDoc"