-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX] Fix broken azure_auth test #544
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. @rdheekonda do you have thoughts on increasing the lower bound on azure-identity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This lambda side-effect solution feels like magic to me 🪄
Clean fix, great work!
Thanks for the fix, @jsong468. Could you confirm that this works with latest version |
This PR addresses the error that was thrown when trying to run the
test_get_token_provider_from_default_azure_credential
test. This error arose as a result of changes in azure-identity version 1.18 which introduced aget_token_info
method which returns an AccessTokenInfo object. Theget_token_info
method is an alternative method to the previously existingget_token
"that improves support for more complex authentication scenarios" and is the default for authentication aside from when thecredential
object does not have theget_token_info
attribute. Thus, the unit tests now mockhasattr
for 'get_token_info' arg.This PR adds unit tests to use both the
get_token
andget_token_info
methods when callingget_token_provider_from_default_azure_credential
to connect to an AOAI endpoint.Also, instances of
Mock
are changed toMagicMock
.