aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2017-03-20 15:07:07 +0000
committerJustus Winter <[email protected]>2017-03-20 15:07:07 +0000
commit4572e8d2ac1d3b45e75ce71265c99e591fbf0e28 (patch)
tree2e3cffb2d8b61499a793c2ff7eccabcff99b8d0a
parentpython: Make error message more helpful. (diff)
downloadgpgme-4572e8d2ac1d3b45e75ce71265c99e591fbf0e28.tar.gz
gpgme-4572e8d2ac1d3b45e75ce71265c99e591fbf0e28.zip
python: Remove superfluous initialization.
* lang/python/tests/support.py (init_gpgme): Remove. This is an remnant from the c tests. Nowadays, the Python bindings initialize GPGME automagically. * lang/python/tests/initial.py: Remove call to 'support.init_gpgme'. * lang/python/tests/t-callbacks.py: Likewise. * lang/python/tests/t-decrypt-verify.py: Likewise. * lang/python/tests/t-decrypt.py: Likewise. * lang/python/tests/t-edit.py: Likewise. * lang/python/tests/t-encrypt-large.py: Likewise. * lang/python/tests/t-encrypt-sign.py: Likewise. * lang/python/tests/t-encrypt-sym.py: Likewise. * lang/python/tests/t-encrypt.py: Likewise. * lang/python/tests/t-export.py: Likewise. * lang/python/tests/t-file-name.py: Likewise. * lang/python/tests/t-idiomatic.py: Likewise. * lang/python/tests/t-import.py: Likewise. * lang/python/tests/t-keylist.py: Likewise. * lang/python/tests/t-sig-notation.py: Likewise. * lang/python/tests/t-sign.py: Likewise. * lang/python/tests/t-signers.py: Likewise. * lang/python/tests/t-trustlist.py: Likewise. * lang/python/tests/t-verify.py: Likewise. * lang/python/tests/t-wait.py: Likewise. Signed-off-by: Justus Winter <[email protected]>
-rwxr-xr-xlang/python/tests/initial.py2
-rw-r--r--lang/python/tests/support.py3
-rwxr-xr-xlang/python/tests/t-callbacks.py2
-rwxr-xr-xlang/python/tests/t-decrypt-verify.py1
-rwxr-xr-xlang/python/tests/t-decrypt.py1
-rwxr-xr-xlang/python/tests/t-edit.py2
-rwxr-xr-xlang/python/tests/t-encrypt-large.py1
-rwxr-xr-xlang/python/tests/t-encrypt-sign.py1
-rwxr-xr-xlang/python/tests/t-encrypt-sym.py2
-rwxr-xr-xlang/python/tests/t-encrypt.py1
-rwxr-xr-xlang/python/tests/t-export.py1
-rwxr-xr-xlang/python/tests/t-file-name.py1
-rwxr-xr-xlang/python/tests/t-idiomatic.py2
-rwxr-xr-xlang/python/tests/t-import.py1
-rwxr-xr-xlang/python/tests/t-keylist.py1
-rwxr-xr-xlang/python/tests/t-sig-notation.py2
-rwxr-xr-xlang/python/tests/t-sign.py2
-rwxr-xr-xlang/python/tests/t-signers.py2
-rwxr-xr-xlang/python/tests/t-trustlist.py1
-rwxr-xr-xlang/python/tests/t-verify.py2
-rwxr-xr-xlang/python/tests/t-wait.py1
21 files changed, 0 insertions, 32 deletions
diff --git a/lang/python/tests/initial.py b/lang/python/tests/initial.py
index 4a02762b..49e4f82e 100755
--- a/lang/python/tests/initial.py
+++ b/lang/python/tests/initial.py
@@ -27,8 +27,6 @@ import support
print("Using gpg module from {0!r}.".format(os.path.dirname(gpg.__file__)))
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
-
subprocess.check_call([os.path.join(os.getenv('top_srcdir'),
"tests", "start-stop-agent"), "--start"])
diff --git a/lang/python/tests/support.py b/lang/python/tests/support.py
index 69aa7a40..80c3a4bf 100644
--- a/lang/python/tests/support.py
+++ b/lang/python/tests/support.py
@@ -39,9 +39,6 @@ def make_filename(name):
def in_srcdir(name):
return os.path.join(os.environ['srcdir'], name)
-def init_gpgme(proto):
- gpg.core.engine_check_version(proto)
-
verbose = int(os.environ.get('verbose', 0)) > 1
def print_data(data):
if verbose:
diff --git a/lang/python/tests/t-callbacks.py b/lang/python/tests/t-callbacks.py
index eed50bc4..ae157878 100755
--- a/lang/python/tests/t-callbacks.py
+++ b/lang/python/tests/t-callbacks.py
@@ -24,8 +24,6 @@ import os
import gpg
import support
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
-
c = gpg.Context()
c.set_pinentry_mode(gpg.constants.PINENTRY_MODE_LOOPBACK)
diff --git a/lang/python/tests/t-decrypt-verify.py b/lang/python/tests/t-decrypt-verify.py
index 62431671..03bbc4b5 100755
--- a/lang/python/tests/t-decrypt-verify.py
+++ b/lang/python/tests/t-decrypt-verify.py
@@ -34,7 +34,6 @@ def check_verify_result(result, summary, fpr, status):
assert sig.validity == gpg.constants.validity.FULL
assert gpg.errors.GPGMEError(sig.validity_reason).getcode() == gpg.errors.NO_ERROR
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
c = gpg.Context()
source = gpg.Data(file=support.make_filename("cipher-2.asc"))
diff --git a/lang/python/tests/t-decrypt.py b/lang/python/tests/t-decrypt.py
index 1af05626..05b6d8b0 100755
--- a/lang/python/tests/t-decrypt.py
+++ b/lang/python/tests/t-decrypt.py
@@ -23,7 +23,6 @@ del absolute_import, print_function, unicode_literals
import gpg
import support
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
c = gpg.Context()
source = gpg.Data(file=support.make_filename("cipher-1.asc"))
diff --git a/lang/python/tests/t-edit.py b/lang/python/tests/t-edit.py
index bd70e7ee..7ac3626f 100755
--- a/lang/python/tests/t-edit.py
+++ b/lang/python/tests/t-edit.py
@@ -51,8 +51,6 @@ class KeyEditor(object):
return result
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
-
c = gpg.Context()
c.set_pinentry_mode(gpg.constants.PINENTRY_MODE_LOOPBACK)
c.set_passphrase_cb(lambda *args: "abc")
diff --git a/lang/python/tests/t-encrypt-large.py b/lang/python/tests/t-encrypt-large.py
index cdb4a32a..56460851 100755
--- a/lang/python/tests/t-encrypt-large.py
+++ b/lang/python/tests/t-encrypt-large.py
@@ -30,7 +30,6 @@ if len(sys.argv) == 2:
else:
nbytes = 100000
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
c = gpg.Context()
ntoread = nbytes
diff --git a/lang/python/tests/t-encrypt-sign.py b/lang/python/tests/t-encrypt-sign.py
index 094a2b00..f04783f4 100755
--- a/lang/python/tests/t-encrypt-sign.py
+++ b/lang/python/tests/t-encrypt-sign.py
@@ -24,7 +24,6 @@ import sys
import gpg
import support
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
c = gpg.Context()
c.set_armor(True)
diff --git a/lang/python/tests/t-encrypt-sym.py b/lang/python/tests/t-encrypt-sym.py
index 07e6b62c..c15955a9 100755
--- a/lang/python/tests/t-encrypt-sym.py
+++ b/lang/python/tests/t-encrypt-sym.py
@@ -24,8 +24,6 @@ import os
import gpg
import support
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
-
for passphrase in ("abc", b"abc"):
c = gpg.Context()
c.set_armor(True)
diff --git a/lang/python/tests/t-encrypt.py b/lang/python/tests/t-encrypt.py
index 3cbe8f2f..921502a7 100755
--- a/lang/python/tests/t-encrypt.py
+++ b/lang/python/tests/t-encrypt.py
@@ -23,7 +23,6 @@ del absolute_import, print_function, unicode_literals
import gpg
import support
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
c = gpg.Context()
c.set_armor(True)
diff --git a/lang/python/tests/t-export.py b/lang/python/tests/t-export.py
index 4927beb0..b9d52048 100755
--- a/lang/python/tests/t-export.py
+++ b/lang/python/tests/t-export.py
@@ -23,7 +23,6 @@ del absolute_import, print_function, unicode_literals
import gpg
import support
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
c = gpg.Context()
c.set_armor(True)
diff --git a/lang/python/tests/t-file-name.py b/lang/python/tests/t-file-name.py
index d12afb86..aab56802 100755
--- a/lang/python/tests/t-file-name.py
+++ b/lang/python/tests/t-file-name.py
@@ -26,7 +26,6 @@ import support
testname = "abcde12345"
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
c = gpg.Context()
c.set_armor(True)
diff --git a/lang/python/tests/t-idiomatic.py b/lang/python/tests/t-idiomatic.py
index 485f0486..826bc23c 100755
--- a/lang/python/tests/t-idiomatic.py
+++ b/lang/python/tests/t-idiomatic.py
@@ -27,8 +27,6 @@ import tempfile
import gpg
import support
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
-
# Both Context and Data can be used as context manager:
with gpg.Context() as c, gpg.Data() as d:
c.get_engine_info()
diff --git a/lang/python/tests/t-import.py b/lang/python/tests/t-import.py
index 5b0576f2..e2edf5a2 100755
--- a/lang/python/tests/t-import.py
+++ b/lang/python/tests/t-import.py
@@ -67,7 +67,6 @@ def check_result(result, fpr, secret):
assert len(result.imports) == 1 or fpr == result.imports[1].fpr
assert result.imports[0].result == 0
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
c = gpg.Context()
c.op_import(gpg.Data(file=support.make_filename("pubkey-1.asc")))
diff --git a/lang/python/tests/t-keylist.py b/lang/python/tests/t-keylist.py
index 5077ca69..76c793e7 100755
--- a/lang/python/tests/t-keylist.py
+++ b/lang/python/tests/t-keylist.py
@@ -23,7 +23,6 @@ del absolute_import, print_function, unicode_literals
import gpg
import support
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
c = gpg.Context()
# Check expration of keys. This test assumes three subkeys of which
diff --git a/lang/python/tests/t-sig-notation.py b/lang/python/tests/t-sig-notation.py
index f1342b1f..22774974 100755
--- a/lang/python/tests/t-sig-notation.py
+++ b/lang/python/tests/t-sig-notation.py
@@ -62,8 +62,6 @@ def check_result(result):
assert len(expected_notations) == 0
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
-
source = gpg.Data("Hallo Leute\n")
signed = gpg.Data()
diff --git a/lang/python/tests/t-sign.py b/lang/python/tests/t-sign.py
index 9418ed88..d3757294 100755
--- a/lang/python/tests/t-sign.py
+++ b/lang/python/tests/t-sign.py
@@ -53,8 +53,6 @@ def check_result(r, typ):
if signature.fpr != "A0FF4590BB6122EDEF6E3C542D727CC768697734":
fail("Wrong fingerprint reported: {}".format(signature.fpr))
-
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
c = gpg.Context()
c.set_textmode(True)
c.set_armor(True)
diff --git a/lang/python/tests/t-signers.py b/lang/python/tests/t-signers.py
index 80e797c9..5864ee5f 100755
--- a/lang/python/tests/t-signers.py
+++ b/lang/python/tests/t-signers.py
@@ -53,8 +53,6 @@ def check_result(r, typ):
"23FD347A419429BACCD5E72D6BC4778054ACD246"):
fail("Wrong fingerprint reported: {}".format(signature.fpr))
-
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
c = gpg.Context()
c.set_textmode(True)
c.set_armor(True)
diff --git a/lang/python/tests/t-trustlist.py b/lang/python/tests/t-trustlist.py
index 8c5e2143..85865965 100755
--- a/lang/python/tests/t-trustlist.py
+++ b/lang/python/tests/t-trustlist.py
@@ -23,7 +23,6 @@ del absolute_import, print_function, unicode_literals
import gpg
import support
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
c = gpg.Context()
def dump_item(item):
diff --git a/lang/python/tests/t-verify.py b/lang/python/tests/t-verify.py
index f18e1ddc..03476382 100755
--- a/lang/python/tests/t-verify.py
+++ b/lang/python/tests/t-verify.py
@@ -97,8 +97,6 @@ def check_result(result, summary, validity, fpr, status, notation):
sig.validity, validity)
assert gpg.errors.GPGMEError(sig.validity_reason).getcode() == gpg.errors.NO_ERROR
-
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
c = gpg.Context()
c.set_armor(True)
diff --git a/lang/python/tests/t-wait.py b/lang/python/tests/t-wait.py
index b1f2043f..0c403fa6 100755
--- a/lang/python/tests/t-wait.py
+++ b/lang/python/tests/t-wait.py
@@ -24,7 +24,6 @@ import time
import gpg
import support
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
c = gpg.Context()
c.set_armor(True)