From 307f382033631dc9668c4d5a331acc16b6e66d7a Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Wed, 25 Oct 2017 13:54:58 +0200 Subject: openpgp: Explicitly detect the lack of supported implementation --- tests/test_openpgp.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'tests/test_openpgp.py') diff --git a/tests/test_openpgp.py b/tests/test_openpgp.py index dd2cef1..dc2eafc 100644 --- a/tests/test_openpgp.py +++ b/tests/test_openpgp.py @@ -162,6 +162,8 @@ class OpenPGPCorrectKeyTest(unittest.TestCase): try: self.env.import_key( io.BytesIO(PUBLIC_KEY.encode('utf8'))) + except gemato.exceptions.OpenPGPNoImplementation as e: + raise unittest.SkipTest(str(e)) except RuntimeError: raise unittest.SkipTest('Unable to import OpenPGP key') @@ -195,5 +197,8 @@ class OpenPGPNoKeyTest(unittest.TestCase): def test_verify_manifest(self): with io.BytesIO(SIGNED_MANIFEST.encode('utf8')) as f: - self.assertRaises(gemato.exceptions.OpenPGPVerificationFailure, - self.env.verify_file, f) + try: + self.assertRaises(gemato.exceptions.OpenPGPVerificationFailure, + self.env.verify_file, f) + except gemato.exceptions.OpenPGPNoImplementation as e: + raise unittest.SkipTest(str(e)) -- cgit v1.2.3