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
fix test
Ishaan Jaff96d5f891df1f
diff --git a/tests/test_litellm/proxy/client/cli/test_keys_commands.py b/tests/test_litellm/proxy/client/cli/test_keys_commands.pyindex ee6fc478ec5..8b7abc4ea40 100644--- a/tests/test_litellm/proxy/client/cli/test_keys_commands.py+++ b/tests/test_litellm/proxy/client/cli/test_keys_commands.py@@ -40,7 +40,7 @@ def mock_keys_client():yield MockClient-def test_keys_list_json_format(mock_keys_client, cli_runner):+def test_async_keys_list_json_format(mock_keys_client, cli_runner):mock_keys_client.return_value.list.return_value = {"keys": [{@@ -60,7 +60,7 @@ def test_keys_list_json_format(mock_keys_client, cli_runner):mock_keys_client.return_value.list.assert_called_once()-def test_keys_list_table_format(mock_keys_client, cli_runner):+def test_async_keys_list_table_format(mock_keys_client, cli_runner):mock_keys_client.return_value.list.return_value = {"keys": [{@@ -83,7 +83,7 @@ def test_keys_list_table_format(mock_keys_client, cli_runner):mock_keys_client.return_value.list.assert_called_once()-def test_keys_generate_success(mock_keys_client, cli_runner):+def test_async_keys_generate_success(mock_keys_client, cli_runner):mock_keys_client.return_value.generate.return_value = {"key": "new-key","spend": 100.0,@@ -96,7 +96,7 @@ def test_keys_generate_success(mock_keys_client, cli_runner):mock_keys_client.return_value.generate.assert_called_once()-def test_keys_delete_success(mock_keys_client, cli_runner):+def test_async_keys_delete_success(mock_keys_client, cli_runner):mock_keys_client.return_value.delete.return_value = {"status": "success","deleted_keys": ["abc123"],@@ -108,21 +108,21 @@ def test_keys_delete_success(mock_keys_client, cli_runner):mock_keys_client.return_value.delete.assert_called_once()-def test_keys_list_error_handling(mock_keys_client, cli_runner):+def test_async_keys_list_error_handling(mock_keys_client, cli_runner):mock_keys_client.return_value.list.side_effect = Exception("API Error")result = cli_runner.invoke(cli, ["keys", "list"])assert result.exit_code != 0assert "API Error" in str(result.exception)-def test_keys_generate_error_handling(mock_keys_client, cli_runner):+def test_async_keys_generate_error_handling(mock_keys_client, cli_runner):mock_keys_client.return_value.generate.side_effect = Exception("API Error")result = cli_runner.invoke(cli, ["keys", "generate", "--models", "gpt-4"])assert result.exit_code != 0assert "API Error" in str(result.exception)-def test_keys_delete_error_handling(mock_keys_client, cli_runner):+def test_async_keys_delete_error_handling(mock_keys_client, cli_runner):import requests# Mock a connection error that would normally happen in CI