| 1265 | self._box.unlock() |
| 1266 | |
| 1267 | def test_relock(self): |
| 1268 | # Test case for bug #1575506: the mailbox class was locking the |
| 1269 | # wrong file object in its flush() method. |
| 1270 | msg = "Subject: sub\n\nbody\n" |
| 1271 | key1 = self._box.add(msg) |
| 1272 | self._box.flush() |
| 1273 | self._box.close() |
| 1274 | |
| 1275 | self._box = self._factory(self._path) |
| 1276 | self._box.lock() |
| 1277 | key2 = self._box.add(msg) |
| 1278 | self._box.flush() |
| 1279 | self.assertTrue(self._box._locked) |
| 1280 | self._box.close() |
| 1281 | |
| 1282 | |
| 1283 | class TestMbox(_TestMboxMMDF, unittest.TestCase): |