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

Method _test_flush_or_close

Lib/test/test_mailbox.py:529–543  ·  view source on GitHub ↗
(self, method, should_call_close)

Source from the content-addressed store, hash-verified

527 self._test_flush_or_close(self._box.close, False)
528
529 def _test_flush_or_close(self, method, should_call_close):
530 contents = [self._template % i for i in range(3)]
531 self._box.add(contents[0])
532 self._box.add(contents[1])
533 self._box.add(contents[2])
534 oldbox = self._box
535 method()
536 if should_call_close:
537 self._box.close()
538 self._box = self._factory(self._path)
539 keys = self._box.keys()
540 self.assertEqual(len(keys), 3)
541 for key in keys:
542 self.assertIn(self._box.get_string(key), contents)
543 oldbox.close()
544
545 def test_dump_message(self):
546 # Write message representations to disk

Callers 2

test_flushMethod · 0.95
test_closeMethod · 0.95

Calls 9

methodFunction · 0.85
lenFunction · 0.85
_factoryMethod · 0.80
assertInMethod · 0.80
addMethod · 0.45
closeMethod · 0.45
keysMethod · 0.45
assertEqualMethod · 0.45
get_stringMethod · 0.45

Tested by

no test coverage detected