mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
fix(common_utils.py): add unit test to ensure custom_endpoint=False is handled correctly
Fixes https://github.com/BerriAI/litellm/issues/9915
This commit is contained in:
parent
fe9c2e8d6d
commit
dcea101a65
1 changed files with 32 additions and 0 deletions
|
@ -0,0 +1,32 @@
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
from fastapi.testclient import TestClient
|
||||||
|
|
||||||
|
sys.path.insert(
|
||||||
|
0, os.path.abspath("../../../..")
|
||||||
|
) # Adds the parent directory to the system path
|
||||||
|
from unittest.mock import MagicMock, patch
|
||||||
|
|
||||||
|
from litellm.llms.databricks.common_utils import DatabricksBase
|
||||||
|
|
||||||
|
|
||||||
|
def test_databricks_validate_environment():
|
||||||
|
databricks_base = DatabricksBase()
|
||||||
|
|
||||||
|
with patch.object(
|
||||||
|
databricks_base, "_get_databricks_credentials"
|
||||||
|
) as mock_get_credentials:
|
||||||
|
try:
|
||||||
|
databricks_base.databricks_validate_environment(
|
||||||
|
api_key=None,
|
||||||
|
api_base="my_api_base",
|
||||||
|
endpoint_type="chat_completions",
|
||||||
|
custom_endpoint=False,
|
||||||
|
headers=None,
|
||||||
|
)
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
mock_get_credentials.assert_called_once()
|
Loading…
Add table
Add a link
Reference in a new issue