diff options
author | Andrew M. Kuchling <amk@amk.ca> | 2006-10-27 16:55:34 (GMT) |
---|---|---|
committer | Andrew M. Kuchling <amk@amk.ca> | 2006-10-27 16:55:34 (GMT) |
commit | 0f87183cf58374f04d12d46c7b885b4a3eaec177 (patch) | |
tree | ac6c4831aa4780740b9ed68e66eccdcde53a9d0d /Lib/test/test_mailbox.py | |
parent | 41eb7164df4f779864cfad52e5470286ef4fcb4c (diff) | |
download | cpython-0f87183cf58374f04d12d46c7b885b4a3eaec177.zip cpython-0f87183cf58374f04d12d46c7b885b4a3eaec177.tar.gz cpython-0f87183cf58374f04d12d46c7b885b4a3eaec177.tar.bz2 |
[Bug #1575506] The _singlefileMailbox class was using the wrong file object in its flush() method, causing an error
Diffstat (limited to 'Lib/test/test_mailbox.py')
-rw-r--r-- | Lib/test/test_mailbox.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py index 6cdc441..40cf192 100644 --- a/Lib/test/test_mailbox.py +++ b/Lib/test/test_mailbox.py @@ -747,6 +747,22 @@ class _TestMboxMMDF(TestMailbox): self._box.lock() self._box.unlock() + def test_relock(self): + # Test case for bug #1575506: the mailbox class was locking the + # wrong file object in its flush() method. + msg = "Subject: sub\n\nbody\n" + key1 = self._box.add(msg) + self._box.flush() + self._box.close() + + self._box = self._factory(self._path) + self._box.lock() + key2 = self._box.add(msg) + self._box.flush() + self.assert_(self._box._locked) + self._box.close() + + class TestMbox(_TestMboxMMDF): |