summaryrefslogtreecommitdiff
path: root/tests/test_smime.py
diff options
context:
space:
mode:
authorJim Carroll <jim@caroll.com>2016-07-28 15:21:21 -0400
committerMatěj Cepl <mcepl@cepl.eu>2017-09-19 16:16:19 +0200
commit9e4cdb29e9b328509cf04991401726b936d55beb (patch)
treef69224e6433cdb1307f4a042ecf51cb4b2484843 /tests/test_smime.py
parentdb146588d60fda5d490395779c525e1f06d66151 (diff)
downloadm2crypto-9e4cdb29e9b328509cf04991401726b936d55beb.tar.gz
Clean up after test_ssl.WriteLoadTestCase tests.
Diffstat (limited to 'tests/test_smime.py')
-rw-r--r--tests/test_smime.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/test_smime.py b/tests/test_smime.py
index d0cdd81..678204b 100644
--- a/tests/test_smime.py
+++ b/tests/test_smime.py
@@ -5,6 +5,7 @@
Copyright (C) 2006 Open Source Applications Foundation. All Rights Reserved.
"""
+import os.path
try:
import unittest2 as unittest
except ImportError:
@@ -63,7 +64,8 @@ class SMIMETestCase(unittest.TestCase):
def test_crlf(self):
self.assertEqual(SMIME.text_crlf(b'foobar'), b'Content-Type: text/plain\r\n\r\nfoobar')
- self.assertEqual(SMIME.text_crlf_bio(BIO.MemoryBuffer(b'foobar')).read(), b'Content-Type: text/plain\r\n\r\nfoobar')
+ self.assertEqual(SMIME.text_crlf_bio(
+ BIO.MemoryBuffer(b'foobar')).read(), b'Content-Type: text/plain\r\n\r\nfoobar')
def test_sign(self):
buf = BIO.MemoryBuffer(self.cleartext)
@@ -171,7 +173,6 @@ class SMIMETestCase(unittest.TestCase):
v = s.verify(p7, data)
self.assertEqual(v, self.cleartext)
-
def verify_cb_dummy_method(self, ok, store):
return verify_cb_dummy_function(ok, store)
@@ -337,6 +338,10 @@ class WriteLoadTestCase(unittest.TestCase):
with BIO.openfile(self.filenameSmime, 'wb') as f:
self.assertEqual(s.write(f, p7, BIO.MemoryBuffer(b'some text')), 1)
+ def tearDown(self):
+ if os.path.exists(self.filename_der):
+ os.unlink(self.filename_der)
+
def test_load_pkcs7(self):
self.assertEqual(SMIME.load_pkcs7(self.filename).type(), SMIME.PKCS7_SIGNED)