summaryrefslogtreecommitdiff
path: root/tests/test_openpgp.py
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2017-10-25 14:06:31 +0200
committerMichał Górny <mgorny@gentoo.org>2017-10-25 14:06:31 +0200
commit3050e47fb95f4cd4628ccca5326e69e0b1c401dd (patch)
tree547aabb6b0a0f3b03c3ea897c90054ccca6e481d /tests/test_openpgp.py
parent5c5289c8810fd66867d890cf170d80997496203a (diff)
downloadgemato-3050e47fb95f4cd4628ccca5326e69e0b1c401dd.tar.gz
openpgp: Improve closed manager handling
Diffstat (limited to 'tests/test_openpgp.py')
-rw-r--r--tests/test_openpgp.py12
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