python: Make test case more robust.
* lang/python/examples/t-edit.py: Check if key is found. Signed-off-by: Justus Winter <justus@gnupg.org>
This commit is contained in:
parent
d60deb8a12
commit
c89d3a71ad
@ -16,6 +16,7 @@
|
|||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
import sys
|
||||||
import os
|
import os
|
||||||
from pyme import core
|
from pyme import core
|
||||||
from pyme.core import Data, Context
|
from pyme.core import Data, Context
|
||||||
@ -53,6 +54,9 @@ else:
|
|||||||
out = Data()
|
out = Data()
|
||||||
c.op_keylist_start(b"Alpha", 0)
|
c.op_keylist_start(b"Alpha", 0)
|
||||||
key = c.op_keylist_next()
|
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)
|
c.op_edit(key, KeyEditor().edit_fnc, out, out)
|
||||||
print("[-- Last response --]")
|
print("[-- Last response --]")
|
||||||
out.seek(0,0)
|
out.seek(0,0)
|
||||||
|
Loading…
Reference in New Issue
Block a user