From bd2d282e572b5d02669238c9e087259b85638477 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Thu, 2 May 2019 22:16:51 -0400 Subject: 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 --- lang/python/tests/t-decrypt.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lang/python/tests/t-decrypt.py') diff --git a/lang/python/tests/t-decrypt.py b/lang/python/tests/t-decrypt.py index c72b51ab..99002749 100755 --- a/lang/python/tests/t-decrypt.py +++ b/lang/python/tests/t-decrypt.py @@ -42,3 +42,13 @@ with gpg.Context() as c: assert len(plaintext) > 0 assert plaintext.find(b'Wenn Sie dies lesen k') >= 0, \ 'Plaintext not found' + + plaintext, _, _ = c.decrypt(open(support.make_filename("cipher-3.asc")), verify=False) + assert len(plaintext) > 0 + assert plaintext.find(b'Reenact Studied Thermos Bonehead Unclasp Opposing') >= 0, \ + 'second Plaintext not found' + + plaintext, _, _ = c.decrypt(open(support.make_filename("cipher-no-sig.asc")), verify=False) + assert len(plaintext) > 0 + assert plaintext.find(b'Viscosity Dispersal Thimble Saturday Flaxseed Deflected') >= 0, \ + 'third Plaintext was not found' -- cgit v1.2.3