From e1cf8bab319ba1dea41ba5d711dbb66ffd8e6fd6 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Mon, 20 Mar 2017 16:00:13 +0100 Subject: python: Skip tests if GnuPG is too old. * lang/python/tests/support.py (assert_gpg_version): New function. * lang/python/tests/t-callbacks.py: Use the new function to skip the test if GnuPG is too old. * lang/python/tests/t-edit.py: Likewise. * lang/python/tests/t-encrypt-sym.py: Likewise. * lang/python/tests/t-quick-key-creation.py: Likewise. * lang/python/tests/t-quick-key-manipulation.py: Likewise. * lang/python/tests/t-quick-key-signing.py: Likewise. GnuPG-bug-id: 3008 Signed-off-by: Justus Winter --- lang/python/tests/support.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lang/python/tests/support.py') diff --git a/lang/python/tests/support.py b/lang/python/tests/support.py index 80c3a4bf..8f9d6452 100644 --- a/lang/python/tests/support.py +++ b/lang/python/tests/support.py @@ -26,6 +26,13 @@ import tempfile import time import gpg +def assert_gpg_version(version=(2, 1, 0)): + with gpg.Context() as c: + if tuple(map(int, c.engine_info.version.split('.'))) < version: + print("GnuPG too old: have {0}, need {1}.".format( + c.engine_info.version, '.'.join(version))) + sys.exit(77) + # known keys alpha = "A0FF4590BB6122EDEF6E3C542D727CC768697734" bob = "D695676BDCEDCC2CDD6152BCFE180B1DA9E3B0B2" -- cgit v1.2.3