The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
sys.path.insert for cli tests
Ishaan Jaff782ba9f5a003
diff --git a/tests/test_litellm/proxy/client/cli/test_auth_commands.py b/tests/test_litellm/proxy/client/cli/test_auth_commands.pyindex 33e5ba29bf0..611fde7767e 100644--- a/tests/test_litellm/proxy/client/cli/test_auth_commands.py+++ b/tests/test_litellm/proxy/client/cli/test_auth_commands.py@@ -1,10 +1,16 @@import jsonimport os+import sysimport tempfileimport timefrom pathlib import Pathfrom unittest.mock import MagicMock, Mock, mock_open, patch+sys.path.insert(+ 0, os.path.abspath("../../..")+) # Adds the parent directory to the system path++import pytestfrom click.testing import CliRunnerdiff --git a/tests/test_litellm/proxy/client/cli/test_chat_commands.py b/tests/test_litellm/proxy/client/cli/test_chat_commands.pyindex 0b785f4962c..1226c3557ff 100644--- a/tests/test_litellm/proxy/client/cli/test_chat_commands.py+++ b/tests/test_litellm/proxy/client/cli/test_chat_commands.py@@ -1,10 +1,17 @@import json+import os+import sysfrom unittest.mock import MagicMock, patchimport pytestimport requestsfrom click.testing import CliRunner+sys.path.insert(+ 0, os.path.abspath("../../..")+) # Adds the parent directory to the system path++from litellm.proxy.client.cli.main import clidiff --git a/tests/test_litellm/proxy/client/cli/test_credentials_commands.py b/tests/test_litellm/proxy/client/cli/test_credentials_commands.pyindex cae9e79d797..9ad2bd067f3 100644--- a/tests/test_litellm/proxy/client/cli/test_credentials_commands.py+++ b/tests/test_litellm/proxy/client/cli/test_credentials_commands.py@@ -1,10 +1,17 @@import json+import os+import sysfrom unittest.mock import MagicMock, patchimport pytestimport requestsfrom click.testing import CliRunner+sys.path.insert(+ 0, os.path.abspath("../../..")+) # Adds the parent directory to the system path++from litellm.proxy.client.cli.main import clidiff --git a/tests/test_litellm/proxy/client/cli/test_global_options.py b/tests/test_litellm/proxy/client/cli/test_global_options.pyindex b14bfdf92af..980556893a1 100644--- a/tests/test_litellm/proxy/client/cli/test_global_options.py+++ b/tests/test_litellm/proxy/client/cli/test_global_options.py@@ -1,10 +1,16 @@# stdlib importsimport os+import sysfrom unittest.mock import patchimport pytestfrom click.testing import CliRunner+sys.path.insert(+ 0, os.path.abspath("../../..")+) # Adds the parent directory to the system path++from litellm._version import version as litellm_versionfrom litellm.proxy.client.cli import clidiff --git a/tests/test_litellm/proxy/client/cli/test_models_commands.py b/tests/test_litellm/proxy/client/cli/test_models_commands.pyindex 16744f4a895..7f47d14656a 100644--- a/tests/test_litellm/proxy/client/cli/test_models_commands.py+++ b/tests/test_litellm/proxy/client/cli/test_models_commands.py@@ -1,6 +1,7 @@# stdlib importsimport jsonimport os+import sysimport timefrom unittest.mock import patch@@ -9,6 +10,11 @@ import pytest# third party importsfrom click.testing import CliRunner+sys.path.insert(+ 0, os.path.abspath("../../..")+) # Adds the parent directory to the system path++# local importsfrom litellm.proxy.client.cli import clifrom litellm.proxy.client.cli.commands.models import (diff --git a/tests/test_litellm/proxy/client/cli/test_users_commands.py b/tests/test_litellm/proxy/client/cli/test_users_commands.pyindex 9b291c4ec9d..f18ceb30c22 100644--- a/tests/test_litellm/proxy/client/cli/test_users_commands.py+++ b/tests/test_litellm/proxy/client/cli/test_users_commands.py@@ -1,8 +1,15 @@+import os+import sysfrom unittest.mock import patchimport pytestfrom click.testing import CliRunner+sys.path.insert(+ 0, os.path.abspath("../../..")+) # Adds the parent directory to the system path++from litellm.proxy.client.cli import clidiff --git a/tests/test_litellm/proxy/client/test_chat.py b/tests/test_litellm/proxy/client/test_chat.pyindex 2fd5a4a26ff..332edc78575 100644--- a/tests/test_litellm/proxy/client/test_chat.py+++ b/tests/test_litellm/proxy/client/test_chat.py@@ -1,6 +1,14 @@+import os+import sys+import pytestimport requests+sys.path.insert(+ 0, os.path.abspath("../../..")+) # Adds the parent directory to the system path++from litellm.proxy.client.chat import ChatClientfrom litellm.proxy.client.exceptions import UnauthorizedErrordiff --git a/tests/test_litellm/proxy/client/test_client.py b/tests/test_litellm/proxy/client/test_client.pyindex 267e9f074a4..c97094802ce 100644--- a/tests/test_litellm/proxy/client/test_client.py+++ b/tests/test_litellm/proxy/client/test_client.py@@ -1,5 +1,12 @@+import os+import sys+import pytest+sys.path.insert(+ 0, os.path.abspath("../../..")+) # Adds the parent directory to the system path+from litellm.proxy.client import ChatClient, Client, ModelsManagementClientfrom litellm.proxy.client.http_client import HTTPClientfrom litellm.proxy.client.keys import KeysManagementClientdiff --git a/tests/test_litellm/proxy/client/test_credentials.py b/tests/test_litellm/proxy/client/test_credentials.pyindex ef0cc9998c8..a83e1cf0cde 100644--- a/tests/test_litellm/proxy/client/test_credentials.py+++ b/tests/test_litellm/proxy/client/test_credentials.py@@ -1,6 +1,14 @@+import os+import sys+import pytestimport requests+sys.path.insert(+ 0, os.path.abspath("../../..")+) # Adds the parent directory to the system path++from litellm.proxy.client.credentials import CredentialsManagementClientfrom litellm.proxy.client.exceptions import UnauthorizedErrordiff --git a/tests/test_litellm/proxy/client/test_http_client.py b/tests/test_litellm/proxy/client/test_http_client.pyindex 30bb1489c58..3bb6c4cef84 100644--- a/tests/test_litellm/proxy/client/test_http_client.py+++ b/tests/test_litellm/proxy/client/test_http_client.py@@ -1,11 +1,18 @@"""Tests for the HTTP client."""import json+import os+import sysimport pytestimport requestsimport responses+sys.path.insert(+ 0, os.path.abspath("../../..")+) # Adds the parent directory to the system path++from litellm.proxy.client.http_client import HTTPClientdiff --git a/tests/test_litellm/proxy/client/test_http_commands.py b/tests/test_litellm/proxy/client/test_http_commands.pyindex f305efb3354..d1dea3a5541 100644--- a/tests/test_litellm/proxy/client/test_http_commands.py+++ b/tests/test_litellm/proxy/client/test_http_commands.py@@ -1,11 +1,18 @@"""Tests for the HTTP command group."""import json+import os+import sysimport pytestimport responsesfrom click.testing import CliRunner+sys.path.insert(+ 0, os.path.abspath("../../..")+) # Adds the parent directory to the system path++from litellm.proxy.client.cli.commands.http import httpdiff --git a/tests/test_litellm/proxy/client/test_keys.py b/tests/test_litellm/proxy/client/test_keys.pyindex 7ce4452bdc2..4e341e8ea7d 100644--- a/tests/test_litellm/proxy/client/test_keys.py+++ b/tests/test_litellm/proxy/client/test_keys.py@@ -1,6 +1,14 @@+import os+import sys+import pytestimport requests+sys.path.insert(+ 0, os.path.abspath("../../..")+) # Adds the parent directory to the system path++from litellm.proxy.client.exceptions import UnauthorizedErrorfrom litellm.proxy.client.keys import KeysManagementClientdiff --git a/tests/test_litellm/proxy/client/test_model_groups.py b/tests/test_litellm/proxy/client/test_model_groups.pyindex 0afb253149b..4642d96170f 100644--- a/tests/test_litellm/proxy/client/test_model_groups.py+++ b/tests/test_litellm/proxy/client/test_model_groups.py@@ -1,6 +1,14 @@+import os+import sys+import pytestimport requests+sys.path.insert(+ 0, os.path.abspath("../../..")+) # Adds the parent directory to the system path++from litellm.proxy.client import Client, ModelGroupsManagementClientfrom litellm.proxy.client.exceptions import UnauthorizedErrordiff --git a/tests/test_litellm/proxy/client/test_models.py b/tests/test_litellm/proxy/client/test_models.pyindex afd042682b4..1f991d3a1c0 100644--- a/tests/test_litellm/proxy/client/test_models.py+++ b/tests/test_litellm/proxy/client/test_models.py@@ -1,6 +1,15 @@+import os+import sys+import pytestimport requests+sys.path.insert(+ 0, os.path.abspath("../../..")+) # Adds the parent directory to the system path+++from litellm.proxy.client import Client, ModelsManagementClientfrom litellm.proxy.client.exceptions import NotFoundError, UnauthorizedErrordiff --git a/tests/test_litellm/proxy/client/test_users.py b/tests/test_litellm/proxy/client/test_users.pyindex 5bcd783b914..a48cf8f791b 100644--- a/tests/test_litellm/proxy/client/test_users.py+++ b/tests/test_litellm/proxy/client/test_users.py@@ -1,7 +1,14 @@+import os+import sysfrom unittest.mock import MagicMock, patchimport pytest+sys.path.insert(+ 0, os.path.abspath("../../..")+) # Adds the parent directory to the system path++from litellm.proxy.client.users import (NotFoundError,UnauthorizedError,