(self)
| 367 | self.assertEqual(msg.as_string(), expected) |
| 368 | |
| 369 | def test_as_bytes(self): |
| 370 | msg = self._msgobj('msg_01.txt') |
| 371 | with openfile('msg_01.txt', encoding="utf-8") as fp: |
| 372 | data = fp.read().encode('ascii') |
| 373 | self.assertEqual(data, bytes(msg)) |
| 374 | fullrepr = msg.as_bytes(unixfrom=True) |
| 375 | lines = fullrepr.split(b'\n') |
| 376 | self.assertStartsWith(lines[0], b'From ') |
| 377 | self.assertEqual(data, b'\n'.join(lines[1:])) |
| 378 | |
| 379 | def test_as_bytes_policy(self): |
| 380 | msg = self._msgobj('msg_01.txt') |
nothing calls this directly
no test coverage detected