Example #1
0
 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, '')
Example #2
0
 def test_message_flags_short_answered(self):
     m = JMailMessage(meta=b'32 (UID 316 FLAGS (\\Answered))')
     self.assertEqual(m.flags_short, 'R')
Example #3
0
 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)
Example #4
0
 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)
Example #5
0
 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)
Example #6
0
 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)')
Example #7
0
 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(), [''])
Example #8
0
 def test_message_size_human(self):
     m = JMailMessage(source=b'\n\n\n')
     self.assertEqual(m.size_human(), '3.00B')
Example #9
0
 def test_message_parse(self):
     m = JMailMessage(source=b'')
     self.assertIsInstance(m.headers, JMailMessageHeaders)