Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

658 B
Raw Blame
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"