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

Method test_get_message

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

Source from the content-addressed store, hash-verified

259 self.assertRaises(KeyError, lambda: self._box[key0])
260
261 def test_get_message(self):
262 # Get Message representations of messages
263 key0 = self._box.add(self._template % 0)
264 key1 = self._box.add(_sample_message)
265 msg0 = self._box.get_message(key0)
266 self.assertIsInstance(msg0, mailbox.Message)
267 self.assertEqual(msg0['from'], 'foo')
268 self.assertEqual(msg0.get_payload(), '0\n')
269 self._check_sample(self._box.get_message(key1))
270
271 def test_get_bytes(self):
272 # Get bytes representations of messages

Callers

nothing calls this directly

Calls 6

assertIsInstanceMethod · 0.80
get_payloadMethod · 0.80
_check_sampleMethod · 0.80
addMethod · 0.45
get_messageMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected