MCPcopy Index your code
hub / github.com/python/cpython / test_relock

Method test_relock

Lib/test/test_mailbox.py:1267–1280  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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
1283class TestMbox(_TestMboxMMDF, unittest.TestCase):

Callers

nothing calls this directly

Calls 6

_factoryMethod · 0.80
assertTrueMethod · 0.80
addMethod · 0.45
flushMethod · 0.45
closeMethod · 0.45
lockMethod · 0.45

Tested by

no test coverage detected