From 1bff47ee58bcf9d0016fb7ac7e37cbf075abd059 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Mon, 6 Jun 2016 12:49:11 +0200 Subject: 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 --- lang/python/tests/t-trustlist.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'lang/python/tests/t-trustlist.py') 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) -- cgit v1.2.3