Skip to content
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

Testing: unify http client mock #1242

Merged
merged 3 commits into from
Feb 16, 2024

Conversation

richardm-stripe
Copy link
Contributor

Summary

It adds a lot of complexity / opportunity to get things wrong in our testing framework that you always have to specify http_client_mock_streaming vs http_client_mock (and in the beta branch, it balloons and you have http_client_mock_async and http_client_mock_streaming_async). This PR changes HTTPClientMock, instead of constructing it with is_streaming and this determining which self.func was set, we instead have self.funcs and combine the mocking functionality to operate over multiple mocked functions.

@richardm-stripe richardm-stripe enabled auto-merge (squash) February 16, 2024 19:48
@richardm-stripe richardm-stripe requested review from a team and anniel-stripe and removed request for a team February 16, 2024 19:48
Copy link
Contributor

@anniel-stripe anniel-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for doing this!!

@richardm-stripe richardm-stripe merged commit aa7d8bf into master Feb 16, 2024
15 checks passed
@xavdid-stripe xavdid-stripe deleted the richardm-unify-http-client-mock branch May 10, 2024 03:36
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.

None yet

2 participants