test: patch CredentialsManagementClient in CLI (#12304)

This commit is contained in:
Ishaan Jaff 2025-07-03 17:01:50 -07:00 • committed by GitHub
parent 005de79dd5
commit 3ad6b36ffc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -17,10 +17,16 @@ from litellm.proxy.client.cli.main import cli
@pytest.fixture
def mock_credentials_client():
"""Patch the CredentialsManagementClient used by the CLI commands."""
with patch(
"litellm.proxy.client.cli.commands.credentials.CredentialsManagementClient"
) as mock:
yield mock
"litellm.proxy.client.credentials.CredentialsManagementClient"
) as root_patch:
# Ensure the reference used inside the CLI module also points to the mock
with patch(
"litellm.proxy.client.cli.commands.credentials.CredentialsManagementClient",
root_patch,
) as cli_patch:
yield cli_patch
@pytest.fixture