diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-10-25 14:06:31 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-10-25 14:06:31 +0200 |
commit | 3050e47fb95f4cd4628ccca5326e69e0b1c401dd (patch) | |
tree | 547aabb6b0a0f3b03c3ea897c90054ccca6e481d /tests | |
parent | 5c5289c8810fd66867d890cf170d80997496203a (diff) | |
download | gemato-3050e47fb95f4cd4628ccca5326e69e0b1c401dd.tar.gz |
openpgp: Improve closed manager handling
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_openpgp.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_openpgp.py b/tests/test_openpgp.py index 88b105b..11a6f6e 100644 --- a/tests/test_openpgp.py +++ b/tests/test_openpgp.py @@ -222,3 +222,15 @@ class OpenPGPContextManagerTest(unittest.TestCase): env.verify_file(f) except gemato.exceptions.OpenPGPNoImplementation as e: raise unittest.SkipTest(str(e)) + + def test_double_close(self): + with io.BytesIO(SIGNED_MANIFEST.encode('utf8')) as f: + with gemato.openpgp.OpenPGPEnvironment() as env: + env.close() + + def test_home_after_close(self): + with io.BytesIO(SIGNED_MANIFEST.encode('utf8')) as f: + with gemato.openpgp.OpenPGPEnvironment() as env: + env.close() + with self.assertRaises(RuntimeError): + env.home |