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

Method test_consistent_factory

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

Source from the content-addressed store, hash-verified

657 self.assertEqual(msg_returned.get_payload(), '3\n')
658
659 def test_consistent_factory(self):
660 # Add a message.
661 msg = mailbox.MaildirMessage(self._template % 0)
662 msg.set_subdir('cur')
663 msg.set_flags('RF')
664 key = self._box.add(msg)
665
666 # Create new mailbox with
667 class FakeMessage(mailbox.MaildirMessage):
668 pass
669 box = mailbox.Maildir(self._path, factory=FakeMessage)
670 box.colon = self._box.colon
671 msg2 = box.get_message(key)
672 self.assertIsInstance(msg2, FakeMessage)
673
674 def test_initialize_new(self):
675 # 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