mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-02 02:11:58 +00:00
Co-authored-by: yuneng <yuneng@berri.ai> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
18 lines
658 B
Python
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"
|