| 1093 | self.assertEqual(h.encode(), res) |
| 1094 | |
| 1095 | def test_header_splitter(self): |
| 1096 | eq = self.ndiffAssertEqual |
| 1097 | msg = MIMEText('') |
| 1098 | # It'd be great if we could use add_header() here, but that doesn't |
| 1099 | # guarantee an order of the parameters. |
| 1100 | msg['X-Foobar-Spoink-Defrobnit'] = ( |
| 1101 | 'wasnipoop; giraffes="very-long-necked-animals"; ' |
| 1102 | 'spooge="yummy"; hippos="gargantuan"; marshmallows="gooey"') |
| 1103 | sfp = StringIO() |
| 1104 | g = Generator(sfp) |
| 1105 | g.flatten(msg) |
| 1106 | eq(sfp.getvalue(), '''\ |
| 1107 | Content-Type: text/plain; charset="us-ascii" |
| 1108 | MIME-Version: 1.0 |
| 1109 | Content-Transfer-Encoding: 7bit |
| 1110 | X-Foobar-Spoink-Defrobnit: wasnipoop; giraffes="very-long-necked-animals"; |
| 1111 | spooge="yummy"; hippos="gargantuan"; marshmallows="gooey" |
| 1112 | |
| 1113 | ''') |
| 1114 | |
| 1115 | def test_no_semis_header_splitter(self): |
| 1116 | eq = self.ndiffAssertEqual |