-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fail when signature contains error (#285)
Signed-off-by: Jindrich Luza <[email protected]>
- Loading branch information
1 parent
3c42c11
commit 888f994
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import pytest | ||
|
||
from pubtools._quay.signer_wrapper import MsgSignerWrapper, SigningError | ||
|
||
|
||
def test_store_error_signatures(msg_signer_settings, fake_cert_key_paths, dest_manifest_list): | ||
msg_signer = MsgSignerWrapper(config_file="fake-config-file", settings=msg_signer_settings) | ||
with pytest.raises(SigningError): | ||
msg_signer._store_signed( | ||
{ | ||
"operation": {"references": ["fake-reference"]}, | ||
"operation_results": [ | ||
( | ||
{ | ||
"msg": { | ||
"errors": ["simulated error"], | ||
"manifest_digest": "fake-digest", | ||
"reference": "fake-reference", | ||
"repository": "fake-repo", | ||
} | ||
}, | ||
None, | ||
) | ||
], | ||
} | ||
) |