From 6f0b34c7715d295bef9b4e99fb09ba4f2403b8dd Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Wed, 15 Nov 2023 17:33:15 -0800 Subject: [PATCH] (chore) remvoe bloat testing --- litellm/tests/test_api_key_param.py | 53 ----------------- litellm/tests/test_client.py | 90 ----------------------------- 2 files changed, 143 deletions(-) delete mode 100644 litellm/tests/test_api_key_param.py delete mode 100644 litellm/tests/test_client.py diff --git a/litellm/tests/test_api_key_param.py b/litellm/tests/test_api_key_param.py deleted file mode 100644 index 9745cf83a3..0000000000 --- a/litellm/tests/test_api_key_param.py +++ /dev/null @@ -1,53 +0,0 @@ -# #### What this tests #### -# # This tests the ability to set api key's via the params instead of as environment variables - -# import sys, os -# import traceback - -# sys.path.insert( -# 0, os.path.abspath("../..") -# ) # Adds the parent directory to the system path -# import litellm -# from litellm import embedding, completion - -# litellm.set_verbose = False - - -# def logger_fn(model_call_object: dict): -# print(f"model call details: {model_call_object}") - - -# user_message = "Hello, how are you?" -# messages = [{"content": user_message, "role": "user"}] - -# ## Test 1: Setting key dynamically -# temp_key = os.environ.get("ANTHROPIC_API_KEY", "") -# os.environ["ANTHROPIC_API_KEY"] = "bad-key" -# # test on openai completion call -# try: -# response = completion( -# model="claude-instant-1", -# messages=messages, -# logger_fn=logger_fn, -# api_key=temp_key, -# ) -# print(f"response: {response}") -# except: -# print(f"error occurred: {traceback.format_exc()}") -# pass -# os.environ["ANTHROPIC_API_KEY"] = temp_key - - -# ## Test 2: Setting key via __init__ params -# litellm.anthropic_key = os.environ.get("ANTHROPIC_API_KEY", "") -# os.environ.pop("ANTHROPIC_API_KEY") -# # test on openai completion call -# try: -# response = completion( -# model="claude-instant-1", messages=messages, logger_fn=logger_fn -# ) -# print(f"response: {response}") -# except: -# print(f"error occurred: {traceback.format_exc()}") -# pass -# os.environ["ANTHROPIC_API_KEY"] = temp_key diff --git a/litellm/tests/test_client.py b/litellm/tests/test_client.py deleted file mode 100644 index 123e2b3cd5..0000000000 --- a/litellm/tests/test_client.py +++ /dev/null @@ -1,90 +0,0 @@ -# #### What this tests #### -# # This tests error logging (with custom user functions) for the `completion` + `embedding` endpoints w/ callbacks -# # This only tests posthog, sentry, and helicone -# import sys, os -# import traceback -# import pytest - -# sys.path.insert( -# 0, os.path.abspath("../..") -# ) # Adds the parent directory to the system path -# import litellm -# from litellm import embedding, completion - -# litellm.success_callback = ["posthog", "helicone"] -# litellm.failure_callback = ["sentry", "posthog"] - -# litellm.set_verbose = True - - -# def logger_fn(model_call_object: dict): -# # print(f"model call details: {model_call_object}") -# pass - - -# user_message = "Hello, how are you?" -# messages = [{"content": user_message, "role": "user"}] - - -# def test_completion_openai(): -# try: -# print("running query") -# response = completion( -# model="gpt-3.5-turbo", messages=messages, logger_fn=logger_fn -# ) -# print(f"response: {response}") -# # Add any assertions here to check the response -# except Exception as e: -# traceback.print_exc() -# pytest.fail(f"Error occurred: {e}") - - -# def test_completion_claude(): -# try: -# response = completion( -# model="claude-instant-1", messages=messages, logger_fn=logger_fn -# ) -# # Add any assertions here to check the response -# except Exception as e: -# pytest.fail(f"Error occurred: {e}") - - -# def test_completion_non_openai(): -# try: -# response = completion( -# model="claude-instant-1", messages=messages, logger_fn=logger_fn -# ) -# # Add any assertions here to check the response -# except Exception as e: -# pytest.fail(f"Error occurred: {e}") - - -# def test_embedding_openai(): -# try: -# response = embedding( -# model="text-embedding-ada-002", input=[user_message], logger_fn=logger_fn -# ) -# # Add any assertions here to check the response -# print(f"response: {str(response)[:50]}") -# except Exception as e: -# pytest.fail(f"Error occurred: {e}") - - -# def test_bad_azure_embedding(): -# try: -# response = embedding( -# model="chatgpt-test", input=[user_message], logger_fn=logger_fn -# ) -# # Add any assertions here to check the response -# print(f"response: {str(response)[:50]}") -# except Exception as e: -# pass - - -# # def test_good_azure_embedding(): -# # try: -# # response = embedding(model='azure/azure-embedding-model', input=[user_message], logger_fn=logger_fn) -# # # Add any assertions here to check the response -# # print(f"response: {str(response)[:50]}") -# # except Exception as e: -# # pytest.fail(f"Error occurred: {e}")