[Pkg-gnupg-commit] [gpgme] 233/412: python: Fix test.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Thu Sep 22 21:26:53 UTC 2016


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch master
in repository gpgme.

commit fddcc62abd57cb04e84861abd3991c7d529c2464
Author: Justus Winter <justus at g10code.com>
Date:   Thu Jul 14 13:22:59 2016 +0200

    python: Fix test.
    
    * lang/python/tests/t-keylist.py: Do not assume key alpha is trusted
    yet.
    
    Signed-off-by: Justus Winter <justus at g10code.com>
---
 lang/python/tests/t-keylist.py | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/lang/python/tests/t-keylist.py b/lang/python/tests/t-keylist.py
index a840d91..ee9c283 100755
--- a/lang/python/tests/t-keylist.py
+++ b/lang/python/tests/t-keylist.py
@@ -99,7 +99,7 @@ keys = [
       [ [ "Zulu Test", "demo key", "zulu at example.net" ] ], 1 ],
 ]
 
-def check_global(i, key, uids, n_subkeys):
+def check_global(key, uids, n_subkeys):
     assert not key.revoked, "Key unexpectedly revoked"
     assert not key.expired, "Key unexpectedly expired"
     assert not key.disabled, "Key unexpectedly disabled"
@@ -115,13 +115,8 @@ def check_global(i, key, uids, n_subkeys):
         "Key unexpectedly carries issuer name: {}".format(key.issuer_name)
     assert not key.chain_id, \
         "Key unexpectedly carries chain ID: {}".format(key.chain_id)
-
-    # Only key Alfa is trusted
-    assert i == 0 or key.owner_trust == constants.VALIDITY_UNKNOWN, \
-        "Key has unexpected owner trust: {}".format(key.owner_trust)
-    assert i != 0 or key.owner_trust == constants.VALIDITY_ULTIMATE, \
+    assert key.owner_trust == constants.VALIDITY_UNKNOWN, \
         "Key has unexpected owner trust: {}".format(key.owner_trust)
-
     assert len(key.subkeys) - 1 == n_subkeys, \
         "Key `{}' has unexpected number of subkeys".format(uids[0][0])
 
@@ -166,10 +161,7 @@ def check_subkey(fpr, which, subkey):
 def check_uid(which, ref, uid):
     assert not uid.revoked, which + " user ID unexpectedly revoked"
     assert not uid.invalid, which + " user ID unexpectedly invalid"
-    assert uid.validity == (constants.VALIDITY_UNKNOWN
-                            if uid.name.split()[0]
-                            not in {'Alfa', 'Alpha', 'Alice'} else
-                            constants.VALIDITY_ULTIMATE), \
+    assert uid.validity == constants.VALIDITY_UNKNOWN, \
       which + " user ID has unexpectedly validity: {}".format(uid.validity)
     assert not uid.signatures, which + " user ID unexpectedly signed"
     assert uid.name == ref[0], \
@@ -195,7 +187,7 @@ while key:
         break
 
     # Global key flags.
-    check_global(i, key, uids, n_subkeys)
+    check_global(key, uids, n_subkeys)
     check_subkey(fpr, "Primary", key.subkeys[0])
     check_subkey(sec_keyid, "Secondary", key.subkeys[1])
 
@@ -228,7 +220,7 @@ for i, key in enumerate(c.op_keylist_all(None, False)):
         break
 
     # Global key flags.
-    check_global(i, key, uids, n_subkeys)
+    check_global(key, uids, n_subkeys)
     check_subkey(fpr, "Primary", key.subkeys[0])
     check_subkey(sec_keyid, "Secondary", key.subkeys[1])
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gpgme.git



More information about the Pkg-gnupg-commit mailing list