diff options
| author | Justus Winter <[email protected]> | 2016-09-12 12:53:08 +0000 | 
|---|---|---|
| committer | Justus Winter <[email protected]> | 2016-09-12 12:56:07 +0000 | 
| commit | a0263ad282d350b548cbbc27e96f196d9217d040 (patch) | |
| tree | 086c0bd6234ff613bc5f6cbe239171a5b2169538 /lang/python/tests/t-sig-notation.py | |
| parent | qt: Fix some includes (diff) | |
| download | gpgme-a0263ad282d350b548cbbc27e96f196d9217d040.tar.gz gpgme-a0263ad282d350b548cbbc27e96f196d9217d040.zip | |
tests: Make signature notation test compatible with older GnuPGs.
* lang/python/tests/t-sig-notation.py: Only check the critical flag
when GnuPG >= 2.1.13 is used.
* tests/gpg/t-sig-notation.c: Likewise.
Fixes-commit: c88c9ef3
Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to '')
| -rwxr-xr-x | lang/python/tests/t-sig-notation.py | 11 | 
1 files changed, 10 insertions, 1 deletions
| diff --git a/lang/python/tests/t-sig-notation.py b/lang/python/tests/t-sig-notation.py index 0f77e37a..b024bb5a 100755 --- a/lang/python/tests/t-sig-notation.py +++ b/lang/python/tests/t-sig-notation.py @@ -29,6 +29,14 @@ expected_notations = {      None: ("http://www.gnu.org/policy/", 0),  } +# GnuPG prior to 2.1.13 did not report the critical flag correctly. +with core.Context() as c: +    version = c.engine_info.version +    have_correct_sig_data = not (version.startswith("1.") +                                 or version == "2.1.1" +                                 or (version.startswith("2.1.1") +                                     and version[5] < '3')) +  def check_result(result):      assert len(result.signatures) == 1, "Unexpected number of signatures"      sig = result.signatures[0] @@ -45,7 +53,8 @@ def check_result(result):          assert r.human_readable \              == bool(flags&constants.SIG_NOTATION_HUMAN_READABLE)          assert r.critical \ -            == bool(flags&constants.SIG_NOTATION_CRITICAL) +            == (bool(flags&constants.SIG_NOTATION_CRITICAL) +                if have_correct_sig_data else False)      assert len(expected_notations) == 0 | 
