aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python/tests/support.py
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2017-03-21 11:32:31 +0000
committerJustus Winter <[email protected]>2017-03-21 11:55:33 +0000
commitf3e8d8a4518de2768692e0b392262d0da6d0fd84 (patch)
tree8aaea23c79f205d9c61a36525d14a32f57408601 /lang/python/tests/support.py
parentcore: Extend gpgme_get_dirinfo to return the gpg-wks-client name. (diff)
downloadgpgme-f3e8d8a4518de2768692e0b392262d0da6d0fd84.tar.gz
gpgme-f3e8d8a4518de2768692e0b392262d0da6d0fd84.zip
python: Wrap 'gpgme_op_keylist_from_data_start'.
* NEWS: Update. * lang/python/gpg/core.py (Context.keylist): New keyword argument 'source'. If given, list keys from 'source'. * lang/python/gpgme.i: Wrap the argument to 'gpgme_op_keylist_from_data_start'. * lang/python/tests/Makefile.am (py_tests): Add new test. * lang/python/tests/support.py (EphemeralContext): Do not throw an error if no agent has been started in the context. * lang/python/tests/t-keylist-from-data.py: New file. Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to 'lang/python/tests/support.py')
-rw-r--r--lang/python/tests/support.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/lang/python/tests/support.py b/lang/python/tests/support.py
index 611986b9..680300c1 100644
--- a/lang/python/tests/support.py
+++ b/lang/python/tests/support.py
@@ -109,7 +109,13 @@ def EphemeralContext():
agent_socket = os.path.join(tmp, "S.gpg-agent")
ctx.protocol = gpg.constants.protocol.ASSUAN
ctx.set_engine_info(ctx.protocol, file_name=agent_socket)
- ctx.assuan_transact(["KILLAGENT"])
+ try:
+ ctx.assuan_transact(["KILLAGENT"])
+ except gpg.errors.GPGMEError as e:
+ if e.getcode() == gpg.errors.ASS_CONNECT_FAILED:
+ pass # the agent was not running
+ else:
+ raise
# Block until it is really gone.
while os.path.exists(agent_socket):