mirror of
https://github.com/tiennm99/litellm.git
synced 2026-06-18 00:48:01 +00:00
ef42461c1e
* test: add __init__.py files * refactor: rename test folder to avoid naming conflict * test: update workflows * test: update tests * test: update imports * test: update tests * test: remove unused import * ci(test-litellm.yml): add pytest retry to github workflow * test: fix test
33 lines
869 B
Python
33 lines
869 B
Python
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()
|