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

Method test_consistent_factory

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

Source from the content-addressed store, hash-verified

651 self.assertEqual(msg_returned.get_payload(), '3\n')
652
653 def test_consistent_factory(self):
654 # Add a message.
655 msg = mailbox.MaildirMessage(self._template % 0)
656 msg.set_subdir('cur')
657 msg.set_flags('RF')
658 key = self._box.add(msg)
659
660 # Create new mailbox with
661 class FakeMessage(mailbox.MaildirMessage):
662 pass
663 box = mailbox.Maildir(self._path, factory=FakeMessage)
664 box.colon = self._box.colon
665 msg2 = box.get_message(key)
666 self.assertIsInstance(msg2, FakeMessage)
667
668 def test_initialize_new(self):
669 # Initialize a non-existent mailbox

Callers

nothing calls this directly

Calls 5

set_subdirMethod · 0.95
set_flagsMethod · 0.95
get_messageMethod · 0.95
assertIsInstanceMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected