aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python/tests/t-trustlist.py
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2016-06-06 10:49:11 +0000
committerJustus Winter <[email protected]>2016-07-12 16:34:12 +0000
commit1bff47ee58bcf9d0016fb7ac7e37cbf075abd059 (patch)
tree9e0565d56db6da7b623c02e4d4b9521a0bf89fed /lang/python/tests/t-trustlist.py
parentpython: Improve python packaging. (diff)
downloadgpgme-1bff47ee58bcf9d0016fb7ac7e37cbf075abd059.tar.gz
gpgme-1bff47ee58bcf9d0016fb7ac7e37cbf075abd059.zip
python: Port more tests.
* lang/python/pyme/core.py (Context.op_keylist_all): Add missing 'op_keylist_end'. (Context.op_trustlist_all): Fix function. Add missing 'op_trustlist_end'. * lang/python/tests/Makefile.am (pytests): Add new files. * lang/python/tests/t-import.py: New file. * lang/python/tests/t-keylist.py: Likewise. * lang/python/tests/t-trustlist.py: Check alternate interface. Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to 'lang/python/tests/t-trustlist.py')
-rwxr-xr-xlang/python/tests/t-trustlist.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/lang/python/tests/t-trustlist.py b/lang/python/tests/t-trustlist.py
index 61f8fa52..a24eab8f 100755
--- a/lang/python/tests/t-trustlist.py
+++ b/lang/python/tests/t-trustlist.py
@@ -22,13 +22,19 @@ import support
support.init_gpgme(constants.PROTOCOL_OpenPGP)
c = core.Context()
-c.op_trustlist_start("alice", 0)
+def dump_item(item):
+ print("l={} k={} t={} o={} v={} u={}".format(
+ item.level, item.keyid, item.type, item.owner_trust,
+ item.validity, item.name))
+
+c.op_trustlist_start("alice", 0)
while True:
item = c.op_trustlist_next()
if not item:
break
+ dump_item(item)
+c.op_trustlist_end()
- print("l={} k={} t={} o={} v={} u={}".format(
- item.level, item.keyid, item.type, item.owner_trust,
- item.validity, item.name))
+for item in c.op_trustlist_all("alice", 0):
+ dump_item(item)