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 <justus@g10code.com>
This commit is contained in:
parent
9d6825be09
commit
4572e8d2ac
@ -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"])
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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"))
|
||||
|
@ -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"))
|
||||
|
@ -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")
|
||||
|
@ -30,7 +30,6 @@ if len(sys.argv) == 2:
|
||||
else:
|
||||
nbytes = 100000
|
||||
|
||||
support.init_gpgme(gpg.constants.protocol.OpenPGP)
|
||||
c = gpg.Context()
|
||||
|
||||
ntoread = nbytes
|
||||
|
@ -24,7 +24,6 @@ import sys
|
||||
import gpg
|
||||
import support
|
||||
|
||||
support.init_gpgme(gpg.constants.protocol.OpenPGP)
|
||||
c = gpg.Context()
|
||||
c.set_armor(True)
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -26,7 +26,6 @@ import support
|
||||
|
||||
testname = "abcde12345"
|
||||
|
||||
support.init_gpgme(gpg.constants.protocol.OpenPGP)
|
||||
c = gpg.Context()
|
||||
c.set_armor(True)
|
||||
|
||||
|
@ -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()
|
||||
|
@ -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")))
|
||||
|
@ -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
|
||||
|
@ -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()
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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):
|
||||
|
@ -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)
|
||||
|
||||
|
@ -24,7 +24,6 @@ import time
|
||||
import gpg
|
||||
import support
|
||||
|
||||
support.init_gpgme(gpg.constants.protocol.OpenPGP)
|
||||
c = gpg.Context()
|
||||
c.set_armor(True)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user