diff options
author | JinWang An <jinwang.an@samsung.com> | 2021-12-01 16:54:38 +0900 |
---|---|---|
committer | JinWang An <jinwang.an@samsung.com> | 2021-12-01 16:54:38 +0900 |
commit | 5793c283c7ddc13e62a1eef6ecd38d7e996d6e3f (patch) | |
tree | 984b58b62afb259d96ca5e0af2c737300ca62722 /lang/python/tests | |
parent | a4cc2ca8c024d3187c4ff465a176c7585b533411 (diff) | |
download | gpgme-5793c283c7ddc13e62a1eef6ecd38d7e996d6e3f.tar.gz gpgme-5793c283c7ddc13e62a1eef6ecd38d7e996d6e3f.tar.bz2 gpgme-5793c283c7ddc13e62a1eef6ecd38d7e996d6e3f.zip |
Imported Upstream version 1.13.1upstream/1.13.1
Diffstat (limited to 'lang/python/tests')
-rw-r--r-- | lang/python/tests/Makefile.am | 5 | ||||
-rw-r--r-- | lang/python/tests/Makefile.in | 59 | ||||
-rwxr-xr-x | lang/python/tests/t-decrypt-verify.py | 12 | ||||
-rwxr-xr-x | lang/python/tests/t-decrypt.py | 10 |
4 files changed, 53 insertions, 33 deletions
diff --git a/lang/python/tests/Makefile.am b/lang/python/tests/Makefile.am index d5b6e00..026df03 100644 --- a/lang/python/tests/Makefile.am +++ b/lang/python/tests/Makefile.am @@ -28,7 +28,7 @@ TESTS_ENVIRONMENT = GNUPGHOME=$(GNUPGHOME) \ srcdir=$(srcdir) \ LD_LIBRARY_PATH="../../../src/.libs:$(LD_LIBRARY_PATH)" -py_tests = t-wrapper.py \ +py_tests ?= t-wrapper.py \ t-callbacks.py \ t-data.py \ t-encrypt.py \ @@ -113,8 +113,7 @@ pubring-stamp: $(test_srcdir)/pubdemo.asc gpg-sample.stamp gpg.conf: # This is required for t-sig-notations. echo no-force-v3-sigs > ./gpg.conf - echo ignore-invalid-option agent-program >> ./gpg.conf - echo "agent-program `which $(GPG_AGENT)`|--debug-quick-random" >> ./gpg.conf + echo default-key A0FF4590BB6122EDEF6E3C542D727CC768697734 >> ./gpg.conf gpg-agent.conf: # This is required for gpg2, which does not support command fd. diff --git a/lang/python/tests/Makefile.in b/lang/python/tests/Makefile.in index 3e1f9dd..e41c71f 100644 --- a/lang/python/tests/Makefile.in +++ b/lang/python/tests/Makefile.in @@ -355,34 +355,6 @@ TESTS_ENVIRONMENT = GNUPGHOME=$(GNUPGHOME) \ srcdir=$(srcdir) \ LD_LIBRARY_PATH="../../../src/.libs:$(LD_LIBRARY_PATH)" -py_tests = t-wrapper.py \ - t-callbacks.py \ - t-data.py \ - t-encrypt.py \ - t-encrypt-sym.py \ - t-encrypt-sign.py \ - t-sign.py \ - t-signers.py \ - t-decrypt.py \ - t-verify.py \ - t-decrypt-verify.py \ - t-sig-notation.py \ - t-export.py \ - t-import.py \ - t-trustlist.py \ - t-edit.py \ - t-keylist.py \ - t-keylist-from-data.py \ - t-wait.py \ - t-encrypt-large.py \ - t-file-name.py \ - t-idiomatic.py \ - t-protocol-assuan.py \ - t-quick-key-creation.py \ - t-quick-subkey-creation.py \ - t-quick-key-manipulation.py \ - t-quick-key-signing.py - XTESTS = initial.py $(py_tests) final.py EXTRA_DIST = support.py $(XTESTS) encrypt-only.asc sign-only.asc \ run-tests.py @@ -599,6 +571,34 @@ uninstall-am: .PRECIOUS: Makefile +py_tests ?= t-wrapper.py \ + t-callbacks.py \ + t-data.py \ + t-encrypt.py \ + t-encrypt-sym.py \ + t-encrypt-sign.py \ + t-sign.py \ + t-signers.py \ + t-decrypt.py \ + t-verify.py \ + t-decrypt-verify.py \ + t-sig-notation.py \ + t-export.py \ + t-import.py \ + t-trustlist.py \ + t-edit.py \ + t-keylist.py \ + t-keylist-from-data.py \ + t-wait.py \ + t-encrypt-large.py \ + t-file-name.py \ + t-idiomatic.py \ + t-protocol-assuan.py \ + t-quick-key-creation.py \ + t-quick-subkey-creation.py \ + t-quick-key-manipulation.py \ + t-quick-key-signing.py + # XXX: Currently, one cannot override automake's 'check' target. As a # workaround, we avoid defining 'TESTS', thus automake will not emit # the 'check' target. For extra robustness, we merely define a @@ -636,8 +636,7 @@ pubring-stamp: $(test_srcdir)/pubdemo.asc gpg-sample.stamp gpg.conf: # This is required for t-sig-notations. echo no-force-v3-sigs > ./gpg.conf - echo ignore-invalid-option agent-program >> ./gpg.conf - echo "agent-program `which $(GPG_AGENT)`|--debug-quick-random" >> ./gpg.conf + echo default-key A0FF4590BB6122EDEF6E3C542D727CC768697734 >> ./gpg.conf gpg-agent.conf: # This is required for gpg2, which does not support command fd. diff --git a/lang/python/tests/t-decrypt-verify.py b/lang/python/tests/t-decrypt-verify.py index a0049a0..5307da7 100755 --- a/lang/python/tests/t-decrypt-verify.py +++ b/lang/python/tests/t-decrypt-verify.py @@ -75,3 +75,15 @@ 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 len(verify_result.signatures) == 1 +# 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 c72b51a..9900274 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' |