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

Method test_dump_message

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

Source from the content-addressed store, hash-verified

549 self.assertIs(self._box, box)
550
551 def test_dump_message(self):
552 # Write message representations to disk
553 for input in (email.message_from_string(_sample_message),
554 _sample_message, io.BytesIO(_bytes_sample_message)):
555 output = io.BytesIO()
556 self._box._dump_message(input, output)
557 self.assertEqual(output.getvalue(),
558 _bytes_sample_message.replace(b'\n', os.linesep.encode()))
559 output = io.BytesIO()
560 self.assertRaises(TypeError,
561 lambda: self._box._dump_message(None, output))
562
563 def _get_lock_path(self):
564 # Return the path of the dot lock file. May be overridden.

Callers

nothing calls this directly

Calls 6

getvalueMethod · 0.95
_dump_messageMethod · 0.80
assertEqualMethod · 0.45
replaceMethod · 0.45
encodeMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected