WIP: add tests that operate at the API level #1097
Draft
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.
This is inspired by recent frustrations of surprise behaviour by signingscript, and feeling like the current test-every-tiny-little-function-independently tests wouldn't allow for any sort of confident refactoring. These new tests that I'm adding use the same entry point that
scriptworker
calls into:async_main
, and they mock out as little as they possible can. Currently, this is calls to Autograph, andverify_mar_signature
, but there will probably be other things mocked out (eg: anything that depends on a signature from a real certificate will need to be mocked).Running just these new tests alone already achieves 35% coverage overall, and 27% coverage of
sign.py
:This number will obviously go up as I add tests for other signing types.