[git] GPGME - branch, master, updated. gpgme-1.9.0-26-g979d48e

by Justus Winter cvs at cvs.gnupg.org
Tue Apr 11 12:26:37 CEST 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG Made Easy".

The branch, master has been updated
       via  979d48e823357af9999a2adb34d75adaade8dec2 (commit)
      from  a827382cafe7f1425455dcc8bf5ef049172eb493 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 979d48e823357af9999a2adb34d75adaade8dec2
Author: Justus Winter <justus at g10code.com>
Date:   Tue Apr 11 12:07:59 2017 +0200

    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 <justus at g10code.com>

diff --git a/lang/python/tests/support.py b/lang/python/tests/support.py
index fabd818..efccf31 100644
--- a/lang/python/tests/support.py
+++ b/lang/python/tests/support.py
@@ -35,6 +35,12 @@ def assert_gpg_version(version=(2, 1, 0)):
                 c.engine_info.version, '.'.join(map(str, version))))
             sys.exit(77)
 
+def have_tofu_support(ctx, some_uid):
+    keys = list(ctx.keylist(some_uid,
+                            mode=(gpg.constants.keylist.mode.LOCAL
+                                  |gpg.constants.keylist.mode.WITH_TOFU)))
+    return len(keys) > 0
+
 # Skip the Python tests for GnuPG < 2.1.12.  Prior versions do not
 # understand the command line flags that we assume exist.  C.f. issue
 # 3008.
diff --git a/lang/python/tests/t-quick-key-manipulation.py b/lang/python/tests/t-quick-key-manipulation.py
index 0f47006..37e05b3 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))]:

-----------------------------------------------------------------------

Summary of changes:
 lang/python/tests/support.py                  | 6 ++++++
 lang/python/tests/t-quick-key-manipulation.py | 5 +++++
 2 files changed, 11 insertions(+)


hooks/post-receive
-- 
GnuPG Made Easy
http://git.gnupg.org




More information about the Gnupg-commits mailing list