[Pkg-gnupg-commit] [gpgme] 87/412: python: Make test case more robust.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Thu Sep 22 21:26:22 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 c89d3a71ad20ff02755539a44f254b1e59054c4a
Author: Justus Winter <justus at gnupg.org>
Date:   Thu May 12 11:51:21 2016 +0200

    python: Make test case more robust.
    
    * lang/python/examples/t-edit.py: Check if key is found.
    
    Signed-off-by: Justus Winter <justus at gnupg.org>
---
 lang/python/examples/t-edit.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lang/python/examples/t-edit.py b/lang/python/examples/t-edit.py
index 5553190..5e5857a 100644
--- a/lang/python/examples/t-edit.py
+++ b/lang/python/examples/t-edit.py
@@ -16,6 +16,7 @@
 #    along with this program; if not, write to the Free Software
 #    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
+import sys
 import os
 from pyme import core
 from pyme.core import Data, Context
@@ -53,6 +54,9 @@ else:
     out = Data()
     c.op_keylist_start(b"Alpha", 0)
     key = c.op_keylist_next()
+    if not key:
+        sys.exit("Key Alpha not found.  " +
+                 "Did you point GNUPGHOME to GPGME's tests/gpg dir?")
     c.op_edit(key, KeyEditor().edit_fnc, out, out)
     print("[-- Last response --]")
     out.seek(0,0)

-- 
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