From f526d0e22e8b881ccbca66b46a0e1b68bbc4cd6b Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Thu, 13 Oct 2016 13:13:23 +0200 Subject: python: Make 'get_key' more idiomatic. * lang/python/pyme/core.py (Context.get_key): Raise errors.KeyNotFound if the key is not found. This error is both a KeyError for idiomatic error handling as well as a GPGMEError so we don't break existing code. * lang/python/pyme/errors.py (KeyNotFound): New class. * lang/python/tests/support.py (no_such_key): New variable. * lang/python/tests/t-keylist.py: Test the new behavior. Signed-off-by: Justus Winter --- lang/python/tests/support.py | 1 + 1 file changed, 1 insertion(+) (limited to 'lang/python/tests/support.py') diff --git a/lang/python/tests/support.py b/lang/python/tests/support.py index 4d7135e9..f1ffdc38 100644 --- a/lang/python/tests/support.py +++ b/lang/python/tests/support.py @@ -27,6 +27,7 @@ alpha = "A0FF4590BB6122EDEF6E3C542D727CC768697734" bob = "D695676BDCEDCC2CDD6152BCFE180B1DA9E3B0B2" encrypt_only = "F52770D5C4DB41408D918C9F920572769B9FE19C" sign_only = "7CCA20CCDE5394CEE71C9F0BFED153F12F18F45D" +no_such_key = "A" * 40 def make_filename(name): return os.path.join(os.environ['top_srcdir'], 'tests', 'gpg', name) -- cgit v1.2.3