Skip to content

test_util: Parametrize and refactor tests for build_headers_with_authorization #539

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sonic2kk
Copy link
Contributor

Related: #528, #538.

This PR uses PyTest's Parametrize functionality to parametrize the test for build_headers_with_authorization. It also breaks out the other cases for this test into separate test scenarios, rather than having all of them encompassed in a single test. This improves readability by removing complicated logic from tests and keeping the structure of the test clean ("Arrange-Act-Assert"), and when viewing the tests in a directory with something like pytest --collect-only, it helps view the scenarios more easily.

image

Thanks!

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.

1 participant