(self)
| 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. |
nothing calls this directly
no test coverage detected