def test_message_flags_short(self): m = JMailMessage(meta=b'32 (UID 316 FLAGS ())') self.assertIsInstance(m.flags_short, str) self.assertEqual(m.flags_short, '')
def test_message_flags_short_answered(self): m = JMailMessage(meta=b'32 (UID 316 FLAGS (\\Answered))') self.assertEqual(m.flags_short, 'R')
def test_message_flags_seen(self): m = JMailMessage(meta=b'32 (UID 316 FLAGS (\\Seen))') self.assertIsNone(m.headers) self.assertTupleEqual(m.flags, (b'\\Seen', )) self.assertTrue(m.seen)
def test_message_flags_other(self): m = JMailMessage(meta=b'32 (UID 316 FLAGS (\\Other \\Flags))') self.assertIsNone(m.headers) self.assertTupleEqual(m.flags, (b'\\Other', b'\\Flags')) self.assertFalse(m.seen)
def test_message_flags(self): m = JMailMessage(meta=b'32 (UID 316 FLAGS ())') self.assertIsNone(m.headers) self.assertTupleEqual(m.flags, tuple()) self.assertIsNone(m.seen)
def test_message(self): m = JMailMessage() self.assertIsInstance(repr(m), str) self.assertIsNone(m.headers) self.assertIsInstance(m.flags, tuple) self.assertEqual(str(m), '(.headers=None)')
def test_message_body_lines(self): m = JMailMessage( source=b'Content-Type: text/plain; charset=UTF-8\n\n\n') self.assertListEqual(m.body_lines(), [''])
def test_message_size_human(self): m = JMailMessage(source=b'\n\n\n') self.assertEqual(m.size_human(), '3.00B')
def test_message_parse(self): m = JMailMessage(source=b'') self.assertIsInstance(m.headers, JMailMessageHeaders)