(self)
| 36 | class TestParserBase: |
| 37 | |
| 38 | def test_only_split_on_cr_lf(self): |
| 39 | # The unicode line splitter splits on unicode linebreaks, which are |
| 40 | # more numerous than allowed by the email RFCs; make sure we are only |
| 41 | # splitting on those two. |
| 42 | for parser in self.parsers: |
| 43 | with self.subTest(parser=parser.__name__): |
| 44 | msg = parser( |
| 45 | "Next-Line: not\x85broken\r\n" |
| 46 | "Null: not\x00broken\r\n" |
| 47 | "Vertical-Tab: not\vbroken\r\n" |
| 48 | "Form-Feed: not\fbroken\r\n" |
| 49 | "File-Separator: not\x1Cbroken\r\n" |
| 50 | "Group-Separator: not\x1Dbroken\r\n" |
| 51 | "Record-Separator: not\x1Ebroken\r\n" |
| 52 | "Line-Separator: not\u2028broken\r\n" |
| 53 | "Paragraph-Separator: not\u2029broken\r\n" |
| 54 | "\r\n", |
| 55 | policy=default, |
| 56 | ) |
| 57 | self.assertEqual(msg.items(), [ |
| 58 | ("Next-Line", "not\x85broken"), |
| 59 | ("Null", "not\x00broken"), |
| 60 | ("Vertical-Tab", "not\vbroken"), |
| 61 | ("Form-Feed", "not\fbroken"), |
| 62 | ("File-Separator", "not\x1Cbroken"), |
| 63 | ("Group-Separator", "not\x1Dbroken"), |
| 64 | ("Record-Separator", "not\x1Ebroken"), |
| 65 | ("Line-Separator", "not\u2028broken"), |
| 66 | ("Paragraph-Separator", "not\u2029broken"), |
| 67 | ]) |
| 68 | self.assertEqual(msg.get_payload(), "") |
| 69 | |
| 70 | class MyMessage(EmailMessage): |
| 71 | pass |
nothing calls this directly
no test coverage detected