aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python/tests/t-decrypt-verify.py
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <[email protected]>2019-05-03 02:16:51 +0000
committerDaniel Kahn Gillmor <[email protected]>2019-05-03 02:23:28 +0000
commitbd2d282e572b5d02669238c9e087259b85638477 (patch)
treed1b335044b5da7c412ee5f4da780cd5f0dbbf780 /lang/python/tests/t-decrypt-verify.py
parenttests: add two new types of encrypted data (diff)
downloadgpgme-bd2d282e572b5d02669238c9e087259b85638477.tar.gz
gpgme-bd2d282e572b5d02669238c9e087259b85638477.zip
python/tests: try to decrypt and verify new test data
* lang/python/tests/t-decrypt.py: test decryption of cipher-3.asc and cipher-no-sig.asc * lang/python/tests/t-decrypt-verify.py: test decryption and verification of cipher-3.asc and cipher-no-sig.asc -- note that this introduces a failed test -- decrypt-verify.py misbehaves on cipher-3.asc by throwing a BadSignature even though GnuPG-bug-id: 4276 Signed-off-by: Daniel Kahn Gillmor <[email protected]>
Diffstat (limited to '')
-rwxr-xr-xlang/python/tests/t-decrypt-verify.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/lang/python/tests/t-decrypt-verify.py b/lang/python/tests/t-decrypt-verify.py
index a0049a02..6a4fc554 100755
--- a/lang/python/tests/t-decrypt-verify.py
+++ b/lang/python/tests/t-decrypt-verify.py
@@ -75,3 +75,14 @@ with gpg.Context() as c:
assert e.missing[0] == bob
else:
assert False, "Expected an error, got none"
+
+ plaintext, _, verify_result = c.decrypt(open(support.make_filename("cipher-no-sig.asc")))
+ assert len(plaintext) > 0
+ assert len(verify_result.signatures) == 0
+ assert plaintext.find(b'Viscosity Dispersal Thimble Saturday Flaxseed Deflected') >= 0, \
+ 'unsigned Plaintext was not found'
+
+ plaintext, _, verify_result = c.decrypt(open(support.make_filename("cipher-3.asc")))
+ assert len(plaintext) > 0
+ assert plaintext.find(b'Reenact Studied Thermos Bonehead Unclasp Opposing') >= 0, \
+ 'second Plaintext not found'