mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 03:34:10 +00:00
(test) router - reading os.environ/ with client
This commit is contained in:
parent
2ecbd92f13
commit
179db2a1a7
1 changed files with 6 additions and 2 deletions
|
@ -679,6 +679,7 @@ def test_openai_completion_on_router():
|
|||
|
||||
|
||||
def test_reading_keys_os_environ():
|
||||
import openai
|
||||
try:
|
||||
model_list = [
|
||||
{
|
||||
|
@ -703,10 +704,13 @@ def test_reading_keys_os_environ():
|
|||
assert float(model["litellm_params"]["timeout"]) == float(os.environ["AZURE_TIMEOUT"]), f"{model['litellm_params']['timeout']} vs {os.environ['AZURE_TIMEOUT']}"
|
||||
assert float(model["litellm_params"]["stream_timeout"]) == float(os.environ["AZURE_STREAM_TIMEOUT"]), f"{model['litellm_params']['stream_timeout']} vs {os.environ['AZURE_STREAM_TIMEOUT']}"
|
||||
assert int(model["litellm_params"]["max_retries"]) == int(os.environ["AZURE_MAX_RETRIES"]), f"{model['litellm_params']['max_retries']} vs {os.environ['AZURE_MAX_RETRIES']}"
|
||||
|
||||
print("passed testing of reading keys from os.environ")
|
||||
async_client: openai.AsyncAzureOpenAI = model["async_client"]
|
||||
assert async_client.api_key == os.environ["AZURE_API_KEY"]
|
||||
assert async_client.base_url == os.environ["AZURE_API_BASE"]
|
||||
router.reset()
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
pytest.fail(f"Error occurred: {e}")
|
||||
|
||||
# test_reading_keys_os_environ()
|
||||
test_reading_keys_os_environ()
|
Loading…
Add table
Add a link
Reference in a new issue