aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python/tests/t-quick-key-manipulation.py
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2017-04-11 10:07:59 +0000
committerJustus Winter <[email protected]>2017-04-11 10:24:41 +0000
commit979d48e823357af9999a2adb34d75adaade8dec2 (patch)
tree96954cb3fe4fdbd2d6dae8c65fdfd45b24d080dc /lang/python/tests/t-quick-key-manipulation.py
parentpython: use autoconf pre-processor when building via autoconf (diff)
downloadgpgme-979d48e823357af9999a2adb34d75adaade8dec2.tar.gz
gpgme-979d48e823357af9999a2adb34d75adaade8dec2.zip
python: Skip TOFU test if not supported by GnuPG.
* lang/python/tests/support.py (have_tofu_support): New function. * lang/python/tests/t-quick-key-manipulation.py: Skip TOFU test if not supported by GnuPG. Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to 'lang/python/tests/t-quick-key-manipulation.py')
-rwxr-xr-xlang/python/tests/t-quick-key-manipulation.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/lang/python/tests/t-quick-key-manipulation.py b/lang/python/tests/t-quick-key-manipulation.py
index 0f47006f..37e05b35 100755
--- a/lang/python/tests/t-quick-key-manipulation.py
+++ b/lang/python/tests/t-quick-key-manipulation.py
@@ -22,6 +22,7 @@ del absolute_import, print_function, unicode_literals
import os
import gpg
+import sys
import support
support.assert_gpg_version((2, 1, 14))
@@ -97,6 +98,10 @@ with support.EphemeralContext() as ctx:
with open(os.path.join(ctx.home_dir, "gpg.conf"), "a") as handle:
handle.write("trust-model tofu+pgp\n")
+ if not support.have_tofu_support(ctx, bravo):
+ print("GnuPG does not support TOFU, skipping TOFU tests.")
+ sys.exit()
+
for name, policy in [(name, getattr(gpg.constants.tofu.policy, name))
for name in filter(lambda x: not x.startswith('__'),
dir(gpg.constants.tofu.policy))]: