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

Method test_broken_base64_payload

Lib/test/test_email/test_email.py:698–708  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

696
697 # test_defect_handling:test_invalid_chars_in_base64_payload
698 def test_broken_base64_payload(self):
699 x = 'AwDp0P7//y6LwKEAcPa/6Q=9'
700 msg = Message()
701 msg['content-type'] = 'audio/x-midi'
702 msg['content-transfer-encoding'] = 'base64'
703 msg.set_payload(x)
704 self.assertEqual(msg.get_payload(decode=True),
705 (b'\x03\x00\xe9\xd0\xfe\xff\xff.\x8b\xc0'
706 b'\xa1\x00p\xf6\xbf\xe9\x0f'))
707 self.assertIsInstance(msg.defects[0],
708 errors.InvalidBase64CharactersDefect)
709
710 def test_broken_unicode_payload(self):
711 # This test improves coverage but is not a compliance test.

Callers

nothing calls this directly

Calls 5

set_payloadMethod · 0.95
get_payloadMethod · 0.95
MessageClass · 0.90
assertIsInstanceMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected