MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_relock

Method test_relock

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

Source from the content-addressed store, hash-verified

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
1268class 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