From aaebd83f31b45520bfaf9bba7634672ac1122b89 Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Tue, 23 Sep 2025 16:07:01 -0700 Subject: [PATCH] test fixes --- .../proxy/client/cli/test_auth_commands.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/test_litellm/proxy/client/cli/test_auth_commands.py b/tests/test_litellm/proxy/client/cli/test_auth_commands.py index 5ef96e4f9af..0ea81c70eb1 100644 --- a/tests/test_litellm/proxy/client/cli/test_auth_commands.py +++ b/tests/test_litellm/proxy/client/cli/test_auth_commands.py @@ -159,13 +159,13 @@ class TestTokenUtilities: 'user_id': 'test-user' } - with patch('litellm.proxy.client.cli.commands.auth.load_token', return_value=token_data): + with patch('litellm.litellm_core_utils.cli_token_utils.load_cli_token', return_value=token_data): result = get_stored_api_key() assert result == 'test-api-key-123' def test_get_stored_api_key_no_token(self): """Test getting stored API key when no token exists""" - with patch('litellm.proxy.client.cli.commands.auth.load_token', return_value=None): + with patch('litellm.litellm_core_utils.cli_token_utils.load_cli_token', return_value=None): result = get_stored_api_key() assert result is None @@ -175,7 +175,7 @@ class TestTokenUtilities: 'user_id': 'test-user' } - with patch('litellm.proxy.client.cli.commands.auth.load_token', return_value=token_data): + with patch('litellm.litellm_core_utils.cli_token_utils.load_cli_token', return_value=token_data): result = get_stored_api_key() assert result is None @@ -471,7 +471,7 @@ class TestCLIKeyRegenerationFlow: assert result.exit_code == 0 assert "✅ Login successful!" in result.output - assert "API Key: sk-regenerated-key-456" in result.output + assert "API Key: sk-regenerated-key-4..." in result.output # Verify existing key was retrieved mock_get_stored.assert_called_once() @@ -486,7 +486,9 @@ class TestCLIKeyRegenerationFlow: # Verify polling was done with correct session key mock_get.assert_called() - poll_url = mock_get.call_args[0][0] + # Check that the polling URL was called (should be the first call) + first_call_args = mock_get.call_args_list[0] + poll_url = first_call_args[0][0] assert "sk-new-session-uuid-789" in poll_url # Verify regenerated key was saved