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

Method _check_sample

Lib/test/test_mailbox.py:32–44  ·  view source on GitHub ↗
(self, msg)

Source from the content-addressed store, hash-verified

30 mailbox.BabylMessage, mailbox.MMDFMessage)
31
32 def _check_sample(self, msg):
33 # Inspect a mailbox.Message representation of the sample message
34 self.assertIsInstance(msg, email.message.Message)
35 self.assertIsInstance(msg, mailbox.Message)
36 for key, value in _sample_headers:
37 self.assertIn(value, msg.get_all(key))
38 self.assertTrue(msg.is_multipart())
39 self.assertEqual(len(msg.get_payload()), len(_sample_payloads))
40 for i, payload in enumerate(_sample_payloads):
41 part = msg.get_payload(i)
42 self.assertIsInstance(part, email.message.Message)
43 self.assertNotIsInstance(part, mailbox.Message)
44 self.assertEqual(part.get_payload(), payload)
45
46 def _delete_recursively(self, target):
47 # Delete a file or delete a directory recursively

Callers 15

test_addMethod · 0.80
test_get_messageMethod · 0.80
test_set_itemMethod · 0.80
test_updateMethod · 0.80
test_become_messageMethod · 0.80
test_subdirMethod · 0.80
test_flagsMethod · 0.80
test_infoMethod · 0.80

Calls 9

enumerateFunction · 0.85
assertIsInstanceMethod · 0.80
assertInMethod · 0.80
assertTrueMethod · 0.80
is_multipartMethod · 0.80
get_payloadMethod · 0.80
assertNotIsInstanceMethod · 0.80
get_allMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected