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

Method test_dump_message

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

Source from the content-addressed store, hash-verified

543 oldbox.close()
544
545 def test_dump_message(self):
546 # Write message representations to disk
547 for input in (email.message_from_string(_sample_message),
548 _sample_message, io.BytesIO(_bytes_sample_message)):
549 output = io.BytesIO()
550 self._box._dump_message(input, output)
551 self.assertEqual(output.getvalue(),
552 _bytes_sample_message.replace(b'\n', os.linesep.encode()))
553 output = io.BytesIO()
554 self.assertRaises(TypeError,
555 lambda: self._box._dump_message(None, output))
556
557 def _get_lock_path(self):
558 # 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