refactor: streamline tests and add more #48
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR refactors the tests to leverage the
pytest.mark.parameterizesyntax and removes most of the duplicate in the test files. This made me able to test a bit more (some more usecases, and more tests, like the check of the data sent to the request) while also reducing the number of test lines by half.Doing so I realized a lack of systematization in the way we handle default parameters: sometimes they were not sent to the API at all, sometimes with the SDK default value. If SDK & API defaults are the same, this doesn't change a thing, but otherwise it might create surprises, so I made sure the default SDK parameters are always passed.
Checklist
make install-devcommand)before creating any commit, or I have run successfully the
make lintcommand on my changesmake testcommand on my changesREADME.mdif my changes affected it