mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-14 23:21:35 +00:00
test(secret_managers): cover azure.identity credential fallback path
Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com>
This commit is contained in:
parent
3f4f88372b
commit
0b15d8ed07
1 changed files with 15 additions and 0 deletions
|
|
@ -376,3 +376,18 @@ class TestGetAzureCredential:
|
|||
|
||||
assert credential is mock_credential_instance
|
||||
mock_default_azure_credential.assert_called_once_with()
|
||||
|
||||
@patch.dict(os.environ, {"AZURE_CREDENTIAL": "AzureCliCredential"}, clear=True)
|
||||
@patch("azure.identity.AzureCliCredential")
|
||||
def test_unknown_credential_name_falls_back_to_azure_identity_class(
|
||||
self, mock_azure_cli_credential
|
||||
):
|
||||
"""An AZURE_CREDENTIAL value that isn't in AzureCredentialType is resolved
|
||||
as a class name on azure.identity."""
|
||||
mock_credential_instance = MagicMock()
|
||||
mock_azure_cli_credential.return_value = mock_credential_instance
|
||||
|
||||
credential = get_azure_credential()
|
||||
|
||||
assert credential is mock_credential_instance
|
||||
mock_azure_cli_credential.assert_called_once_with()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue