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/pyme/core.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lang/python/pyme/core.py') diff --git a/lang/python/pyme/core.py b/lang/python/pyme/core.py index 09f71a1a..e5ccf7cd 100644 --- a/lang/python/pyme/core.py +++ b/lang/python/pyme/core.py @@ -255,6 +255,7 @@ class Context(GpgmeWrapper): while key: yield key key = self.op_keylist_next() + self.op_keylist_end() def op_keylist_next(self): """Returns the next key in the list created @@ -285,10 +286,11 @@ class Context(GpgmeWrapper): def op_trustlist_all(self, *args, **kwargs): self.op_trustlist_start(*args, **kwargs) - trust = self.ctx.op_trustlist_next() + trust = self.op_trustlist_next() while trust: yield trust - trust = self.ctx.op_trustlist_next() + trust = self.op_trustlist_next() + self.op_trustlist_end() def op_trustlist_next(self): """Returns the next trust item in the list created -- cgit v1.2.3