summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlang/python/tests/t-decrypt-verify.py11
-rwxr-xr-xlang/python/tests/t-decrypt.py10
2 files changed, 21 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'
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'