mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
* add track_llm_api_timing * add track_llm_api_timing * test_litellm_overhead * use ResponseMetadata class for setting hidden params and response overhead * instrument http handler * fix track_llm_api_timing * track_llm_api_timing * emit response overhead on hidden params * fix resp metadata * fix make_sync_openai_embedding_request * test_aaaaatext_completion_endpoint fixes * _get_value_from_hidden_params * set_hidden_params * test_litellm_overhead * test_litellm_overhead * test_litellm_overhead * fix import * test_litellm_overhead_stream * add LiteLLMLoggingObject * use diff folder for testing * use diff folder for overhead testing * test litellm overhead * use typing * clear typing * test_litellm_overhead * fix async_streaming * update_response_metadata * move test file * pply metadata to the response objec
30 lines
903 B
Python
30 lines
903 B
Python
import json
|
|
import os
|
|
import sys
|
|
from datetime import datetime
|
|
from unittest.mock import AsyncMock, Mock, patch
|
|
|
|
sys.path.insert(
|
|
0, os.path.abspath("../..")
|
|
) # Adds the parent directory to the system path
|
|
import pytest
|
|
|
|
import litellm
|
|
from litellm.proxy._types import KeyManagementSystem
|
|
from litellm.secret_managers.main import get_secret
|
|
|
|
|
|
class MockSecretClient:
|
|
def get_secret(self, secret_name):
|
|
return Mock(value="mocked_secret_value")
|
|
|
|
|
|
@pytest.mark.asyncio
|
|
async def test_azure_kms():
|
|
"""
|
|
Basic asserts that the value from get secret is from Azure Key Vault when Key Management System is Azure Key Vault
|
|
"""
|
|
with patch("litellm.secret_manager_client", new=MockSecretClient()):
|
|
litellm._key_management_system = KeyManagementSystem.AZURE_KEY_VAULT
|
|
secret = get_secret(secret_name="ishaan-test-key")
|
|
assert secret == "mocked_secret_value"
|