python: Remove superfluous initialization.
authorJustus Winter <justus@g10code.com>
Mon, 20 Mar 2017 15:07:07 +0000 (16:07 +0100)
committerJustus Winter <justus@g10code.com>
Mon, 20 Mar 2017 15:07:07 +0000 (16:07 +0100)
* 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 <justus@g10code.com>
21 files changed:
lang/python/tests/initial.py
lang/python/tests/support.py
lang/python/tests/t-callbacks.py
lang/python/tests/t-decrypt-verify.py
lang/python/tests/t-decrypt.py
lang/python/tests/t-edit.py
lang/python/tests/t-encrypt-large.py
lang/python/tests/t-encrypt-sign.py
lang/python/tests/t-encrypt-sym.py
lang/python/tests/t-encrypt.py
lang/python/tests/t-export.py
lang/python/tests/t-file-name.py
lang/python/tests/t-idiomatic.py
lang/python/tests/t-import.py
lang/python/tests/t-keylist.py
lang/python/tests/t-sig-notation.py
lang/python/tests/t-sign.py
lang/python/tests/t-signers.py
lang/python/tests/t-trustlist.py
lang/python/tests/t-verify.py
lang/python/tests/t-wait.py

index 4a02762..49e4f82 100755 (executable)
@@ -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"])
 
index 69aa7a4..80c3a4b 100644 (file)
@@ -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:
index eed50bc..ae15787 100755 (executable)
@@ -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)
 
index 6243167..03bbc4b 100755 (executable)
@@ -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"))
index 1af0562..05b6d8b 100755 (executable)
@@ -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"))
index bd70e7e..7ac3626 100755 (executable)
@@ -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")
index cdb4a32..5646085 100755 (executable)
@@ -30,7 +30,6 @@ if len(sys.argv) == 2:
 else:
     nbytes = 100000
 
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
 c = gpg.Context()
 
 ntoread = nbytes
index 094a2b0..f04783f 100755 (executable)
@@ -24,7 +24,6 @@ import sys
 import gpg
 import support
 
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
 c = gpg.Context()
 c.set_armor(True)
 
index 07e6b62..c15955a 100755 (executable)
@@ -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)
index 3cbe8f2..921502a 100755 (executable)
@@ -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)
 
index 4927beb..b9d5204 100755 (executable)
@@ -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)
 
index d12afb8..aab5680 100755 (executable)
@@ -26,7 +26,6 @@ import support
 
 testname = "abcde12345"
 
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
 c = gpg.Context()
 c.set_armor(True)
 
index 485f048..826bc23 100755 (executable)
@@ -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()
index 5b0576f..e2edf5a 100755 (executable)
@@ -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")))
index 5077ca6..76c793e 100755 (executable)
@@ -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
index f1342b1..2277497 100755 (executable)
@@ -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()
 
index 9418ed8..d375729 100755 (executable)
@@ -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)
index 80e797c..5864ee5 100755 (executable)
@@ -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)
index 8c5e214..8586596 100755 (executable)
@@ -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):
index f18e1dd..0347638 100755 (executable)
@@ -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)
 
index b1f2043..0c403fa 100755 (executable)
@@ -24,7 +24,6 @@ import time
 import gpg
 import support
 
-support.init_gpgme(gpg.constants.protocol.OpenPGP)
 c = gpg.Context()
 c.set_armor(True)