| 1250 | self._box.unlock() |
| 1251 | |
| 1252 | def test_relock(self): |
| 1253 | # Test case for bug #1575506: the mailbox class was locking the |
| 1254 | # wrong file object in its flush() method. |
| 1255 | msg = "Subject: sub\n\nbody\n" |
| 1256 | key1 = self._box.add(msg) |
| 1257 | self._box.flush() |
| 1258 | self._box.close() |
| 1259 | |
| 1260 | self._box = self._factory(self._path) |
| 1261 | self._box.lock() |
| 1262 | key2 = self._box.add(msg) |
| 1263 | self._box.flush() |
| 1264 | self.assertTrue(self._box._locked) |
| 1265 | self._box.close() |
| 1266 | |
| 1267 | |
| 1268 | class TestMbox(_TestMboxMMDF, unittest.TestCase): |