KEMBAR78
Improve test cases to test header-less response by rayluo · Pull Request #822 · AzureAD/microsoft-authentication-library-for-python · GitHub
Skip to content

Conversation

@rayluo
Copy link
Contributor

@rayluo rayluo commented May 15, 2025

MSAL has long been allowing callers to specify their own http client. Early versions of MSAL Python did not require that http client's response to contain headers. This PR changes the test helper to mimic a header-less response by default, so that our existing test cases will automatically cover header-less response scenarios. This can help preventing regression.

P.S.
Issue #817 was created in an aftermath of such a regression. This PR precisely covers those scenarios; therefore, it can resolve #817.
(End-to-end tests, while being useful in their own right, would not be enough to guard against this kind of "header-less response regression", because real e2e requests are typically sent with real http clients that always contain headers.)

Lastly, note that this PR changes only a couple of files in the "./tests" directory. It does not alter any existing MSAL behavior. It is a low-risk PR.

@rayluo rayluo requested a review from a team as a code owner May 15, 2025 21:35
@gladjohn
Copy link

looks good @rayluo. just one minor clarification comment.

@rayluo rayluo merged commit deb61fa into dev May 16, 2025
18 checks passed
@rayluo rayluo deleted the fix-mi-mock branch May 16, 2025 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Add MSI E2E tests

3 participants