summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_mailbox.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-10-26 04:29:23 (GMT)
committerGuido van Rossum <guido@python.org>2007-10-26 04:29:23 (GMT)
commitc12a813aa7671ee12ccb79a70177a62bcefa2561 (patch)
treef6512593e7c4ed8211f2dd2c34c8676b5ed6301e /Lib/test/test_mailbox.py
parentdaa251ca097e7f7382ed57c10efbbaddad103afb (diff)
downloadcpython-c12a813aa7671ee12ccb79a70177a62bcefa2561.zip
cpython-c12a813aa7671ee12ccb79a70177a62bcefa2561.tar.gz
cpython-c12a813aa7671ee12ccb79a70177a62bcefa2561.tar.bz2
Patch # 1331 by Christian Heimes.
The patch fixes some of the problems on Windows. It doesn't introduce addition problems on Linux.
Diffstat (limited to 'Lib/test/test_mailbox.py')
-rw-r--r--Lib/test/test_mailbox.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py
index 0d22164..4345be7 100644
--- a/Lib/test/test_mailbox.py
+++ b/Lib/test/test_mailbox.py
@@ -58,6 +58,7 @@ class TestMailbox(TestBase):
self._box = self._factory(self._path)
def tearDown(self):
+ self._box.close()
self._delete_recursively(self._path)
def test_add(self):
@@ -390,12 +391,14 @@ class TestMailbox(TestBase):
self._box.add(contents[0])
self._box.add(contents[1])
self._box.add(contents[2])
+ oldbox = self._box
method()
self._box = self._factory(self._path)
keys = self._box.keys()
self.assertEqual(len(keys), 3)
for key in keys:
self.assert_(self._box.get_string(key) in contents)
+ oldbox.close()
def test_dump_message(self):
# Write message representations to disk
@@ -403,7 +406,7 @@ class TestMailbox(TestBase):
_sample_message, io.StringIO(_sample_message)):
output = io.StringIO()
self._box._dump_message(input, output)
- self.assert_(output.getvalue() ==
+ self.assertEqual(output.getvalue(),
_sample_message.replace('\n', os.linesep))
output = io.StringIO()
self.assertRaises(TypeError,
@@ -694,6 +697,7 @@ class TestMaildir(TestMailbox):
class _TestMboxMMDF(TestMailbox):
def tearDown(self):
+ self._box.close()
self._delete_recursively(self._path)
for lock_remnant in glob.glob(self._path + '.*'):
test_support.unlink(lock_remnant)
@@ -916,6 +920,7 @@ class TestBabyl(TestMailbox):
_factory = lambda self, path, factory=None: mailbox.Babyl(path, factory)
def tearDown(self):
+ self._box.close()
self._delete_recursively(self._path)
for lock_remnant in glob.glob(self._path + '.*'):
test_support.unlink(lock_remnant)