mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 11:43:54 +00:00
test: cleanup testing
This commit is contained in:
parent
0e2bd1a409
commit
dd429386b0
2 changed files with 33 additions and 23 deletions
|
@ -206,6 +206,9 @@ def test_openai_azure_embedding_with_oidc_and_cf():
|
|||
os.environ["AZURE_TENANT_ID"] = "17c0a27a-1246-4aa1-a3b6-d294e80e783c"
|
||||
os.environ["AZURE_CLIENT_ID"] = "4faf5422-b2bd-45e8-a6d7-46543a38acd0"
|
||||
|
||||
old_key = os.environ["AZURE_API_KEY"]
|
||||
os.environ.pop("AZURE_API_KEY", None)
|
||||
|
||||
try:
|
||||
response = embedding(
|
||||
model="azure/text-embedding-ada-002",
|
||||
|
@ -218,6 +221,8 @@ def test_openai_azure_embedding_with_oidc_and_cf():
|
|||
|
||||
except Exception as e:
|
||||
pytest.fail(f"Error occurred: {e}")
|
||||
finally:
|
||||
os.environ["AZURE_API_KEY"] = old_key
|
||||
|
||||
|
||||
def test_openai_azure_embedding_optional_arg(mocker):
|
||||
|
@ -673,17 +678,3 @@ async def test_databricks_embeddings(sync_mode):
|
|||
# print(response)
|
||||
|
||||
# local_proxy_embeddings()
|
||||
|
||||
|
||||
def test_embedding_azure_ad_token():
|
||||
# this tests if we can pass api_key to completion, when it's not in the env.
|
||||
# DO NOT REMOVE THIS TEST. No MATTER WHAT Happens!
|
||||
# If you want to remove it, speak to Ishaan!
|
||||
# Ishaan will be very disappointed if this test is removed -> this is a standard way to pass api_key + the router + proxy use this
|
||||
|
||||
response = embedding(
|
||||
model="azure/azure-embedding-model",
|
||||
input=["good morning from litellm"],
|
||||
azure_ad_token=os.getenv("AZURE_API_KEY"),
|
||||
)
|
||||
print(response)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue