mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-05 02:41:56 +00:00
test: avoid private API route config access
This commit is contained in:
parent
8c608b311a
commit
6f46550c18
1 changed files with 8 additions and 4 deletions
|
|
@ -40,9 +40,11 @@ def test_api_route_credentials_from_environment(monkeypatch):
|
|||
def test_api_route_uses_default_base_url(monkeypatch):
|
||||
monkeypatch.delenv("API_ROUTE_BASE_URL", raising=False)
|
||||
|
||||
api_base, api_key = APIRouteChatConfig()._get_openai_compatible_provider_info(
|
||||
api_base=None,
|
||||
_, _, api_key, api_base = get_llm_provider(
|
||||
model="api_route/model-name",
|
||||
custom_llm_provider=None,
|
||||
api_key="test-key",
|
||||
api_base=None,
|
||||
)
|
||||
|
||||
assert api_base == "https://global.api-route.com/v1"
|
||||
|
|
@ -52,9 +54,11 @@ def test_api_route_uses_default_base_url(monkeypatch):
|
|||
def test_api_route_explicit_api_base_overrides_default(monkeypatch):
|
||||
monkeypatch.delenv("API_ROUTE_BASE_URL", raising=False)
|
||||
|
||||
api_base, _ = APIRouteChatConfig()._get_openai_compatible_provider_info(
|
||||
api_base="https://custom.example.com/v1",
|
||||
_, _, _, api_base = get_llm_provider(
|
||||
model="api_route/model-name",
|
||||
custom_llm_provider=None,
|
||||
api_key="test-key",
|
||||
api_base="https://custom.example.com/v1",
|
||||
)
|
||||
|
||||
assert api_base == "https://custom.example.com/v1"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue