Skip to content

Improve test cases to test header-less response #822

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

Merged
merged 1 commit into from
May 16, 2025
Merged

Improve test cases to test header-less response #822

merged 1 commit into from
May 16, 2025

Conversation

rayluo
Copy link
Collaborator

@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