Esempio n. 1
0
 def test_get_multiple_cc(self):
     msg = mbox_email(self.open_msg('msg3.txt'))
     self.assertEqual(msg.getCC(),
                      [(u'te Kelrg', '*****@*****.**'),
                       (u'NFP', '*****@*****.**'),
                       (u'Ulri tark', '*****@*****.**'),
                       (u'Schnder Jürn', '*****@*****.**')])
Esempio n. 2
0
 def test_get_to_with_wrong_encoding(self):
     msg = mbox_email(self.open_msg('msg4.txt'))
     self.assertEqual(msg.getTo(), [('', '*****@*****.**')])
Esempio n. 3
0
 def test_get_to(self):
     msg = mbox_email(self.open_msg('msg1.txt'))
     self.assertEqual(msg.getTo(), [(u'John Doe', '*****@*****.**')])
Esempio n. 4
0
 def test_not_attachments(self):
     msg = mbox_email(self.open_msg('msg2.txt'))
     self.assertEqual(msg.getAttachments(), [])
Esempio n. 5
0
 def test_list_attachments(self):
     msg = mbox_email(self.open_msg('msg1.txt'))
     self.assertEqual(msg.getAttachments(), [('test.png', 'test.png')])
Esempio n. 6
0
 def test_get_content(self):
     msg = mbox_email(self.open_msg('msg1.txt'))
     self.assertEqual(
         msg.getContent(),
         '<div style="font-family: \'Courier New\', monospace; '
         'white-space: pre-wrap">test content<br /></div>')
Esempio n. 7
0
 def test_get_cc_with_wrong_encoding(self):
     msg = mbox_email(self.open_msg('msg4.txt'))
     self.assertEqual(msg.getCC(), [('', '*****@*****.**')])
Esempio n. 8
0
 def test_get_date(self):
     msg = mbox_email(self.open_msg('msg1.txt'))
     self.assertEqual(msg.getDateTime(), (2005, 6, 21, 16, 11, 4, 0, 0, 0))
Esempio n. 9
0
 def test_get_subject(self):
     msg = mbox_email(self.open_msg('msg1.txt'))
     self.assertEqual(msg.getSubject(), u'Re: test email')
Esempio n. 10
0
 def test_get_from_with_encoding(self):
     msg = mbox_email(self.open_msg('msg2.txt'))
     self.assertEqual(msg.getFrom(), (u'Geir B&#230;kholt', '*****@*****.**'))
Esempio n. 11
0
 def test_get_from(self):
     msg = mbox_email(self.open_msg('msg1.txt'))
     self.assertEqual(msg.getFrom(), (u'Smith', '*****@*****.**'))
Esempio n. 12
0
 def test_get_to_with_wrong_encoding(self):
     msg = mbox_email(self.open_msg('msg4.txt'))
     self.assertEqual(msg.getTo(), [('', '*****@*****.**')])
Esempio n. 13
0
 def test_get_to_with_encoding(self):
     msg = mbox_email(self.open_msg('msg2.txt'))
     self.assertEqual(msg.getTo(), [(u'Tim Terleg&#229;rd', '*****@*****.**')])
Esempio n. 14
0
 def test_get_to(self):
     msg = mbox_email(self.open_msg('msg1.txt'))
     self.assertEqual(msg.getTo(), [(u'John Doe', '*****@*****.**')])
Esempio n. 15
0
 def test_get_attachment(self):
     msg = mbox_email(self.open_msg('msg1.txt'))
     target = self.open_file('test.png')
     self.assertEqual(msg.getAttachment('test.png'), target)
Esempio n. 16
0
 def test_get_from_with_encoding(self):
     msg = mbox_email(self.open_msg('msg2.txt'))
     self.assertEqual(msg.getFrom(),
                      (u'Geir B&#230;kholt', '*****@*****.**'))
Esempio n. 17
0
 def test_get_subject_with_encoding(self):
     msg = mbox_email(self.open_msg('msg2.txt'))
     self.assertEqual(
         msg.getSubject(),
         u'[Zope] FYI:Portall&#246;sungen f&#252;r den Bildungsbereich /'
         u'  Zope Tagung (German)')
Esempio n. 18
0
 def test_get_subject_with_encoding(self):
     msg = mbox_email(self.open_msg('msg2.txt'))
     self.assertEqual(msg.getSubject(), u'[Zope] FYI:Portall&#246;sungen f&#252;r den Bildungsbereich /  Zope Tagung (German)')
Esempio n. 19
0
 def test_get_subject_with_wrong_encoding(self):
     msg = mbox_email(self.open_msg('msg4.txt'))
     self.assertEqual(msg.getSubject(), '')
Esempio n. 20
0
 def test_get_date(self):
     msg = mbox_email(self.open_msg('msg1.txt'))
     self.assertEqual(msg.getDateTime(), (2005, 6, 21, 16, 11, 4, 0, 0, 0))
Esempio n. 21
0
 def test_not_attachments(self):
     msg = mbox_email(self.open_msg('msg2.txt'))
     self.assertEqual(msg.getAttachments(), [])
Esempio n. 22
0
 def test_get_cc(self):
     msg = mbox_email(self.open_msg('msg1.txt'))
     self.assertEqual(msg.getCC(), [('', '*****@*****.**')])
Esempio n. 23
0
 def test_get_content_with_encoding(self):
     msg = mbox_email(self.open_msg('msg2.txt'))
     self.assertEqual(
         msg.getContent(),
         '<div style="font-family: \'Courier New\', monospace; '
         'white-space: pre-wrap">Urspr&#252;ngliche Nachricht<br /></div>')
Esempio n. 24
0
 def test_get_multiple_cc(self):
     msg = mbox_email(self.open_msg('msg3.txt'))
     self.assertEqual(msg.getCC(), [(u'te Kelrg', '*****@*****.**'), (u'NFP', '*****@*****.**'), (u'Ulri tark', '*****@*****.**'), (u'Schnder J&#252;rn', '*****@*****.**')])
Esempio n. 25
0
 def test_list_multiple_attachments(self):
     msg = mbox_email(self.open_msg('msg3.txt'))
     self.assertEqual(msg.getAttachments(), [('test.png', 'test.png'),
                                             ('test.zip', 'test.zip')])
Esempio n. 26
0
 def test_get_cc_with_encoding(self):
     msg = mbox_email(self.open_msg('msg2.txt'))
     self.assertEqual(msg.getCC(), [(u'Aur&#233;lien Camp&#233;as', '*****@*****.**')])
Esempio n. 27
0
 def test_get_attachment(self):
     msg = mbox_email(self.open_msg('msg1.txt'))
     target = self.open_file('test.png')
     self.assertEqual(msg.getAttachment('test.png'), target)
Esempio n. 28
0
 def test_get_cc_with_wrong_encoding(self):
     msg = mbox_email(self.open_msg('msg4.txt'))
     self.assertEqual(msg.getCC(), [('', '*****@*****.**')])
Esempio n. 29
0
 def test_get_to_with_encoding(self):
     msg = mbox_email(self.open_msg('msg2.txt'))
     self.assertEqual(msg.getTo(),
                      [(u'Tim Terleg&#229;rd', '*****@*****.**')])
Esempio n. 30
0
 def test_get_in_reply_to(self):
     msg = mbox_email(self.open_msg('msg1.txt'))
     self.assertEqual(msg.getInReplyTo(), '<*****@*****.**>')
Esempio n. 31
0
 def test_get_from(self):
     msg = mbox_email(self.open_msg('msg1.txt'))
     self.assertEqual(msg.getFrom(), (u'Smith', '*****@*****.**'))
Esempio n. 32
0
 def test_get_message_id(self):
     msg = mbox_email(self.open_msg('msg1.txt'))
     self.assertEqual(msg.getMessageID(), '<*****@*****.**>')
Esempio n. 33
0
 def test_get_subject(self):
     msg = mbox_email(self.open_msg('msg1.txt'))
     self.assertEqual(msg.getSubject(), u'Re: test email')
Esempio n. 34
0
 def test_get_content(self):
     msg = mbox_email(self.open_msg('msg1.txt'))
     self.assertEqual(msg.getContent(), '<div style="font-family: \'Courier New\', monospace; white-space: pre-wrap">test content<br /></div>')
Esempio n. 35
0
 def test_get_subject_with_wrong_encoding(self):
     msg = mbox_email(self.open_msg('msg4.txt'))
     self.assertEqual(msg.getSubject(), '')
Esempio n. 36
0
 def test_get_content_with_encoding(self):
     msg = mbox_email(self.open_msg('msg2.txt'))
     self.assertEqual(msg.getContent(), '<div style="font-family: \'Courier New\', monospace; white-space: pre-wrap">Urspr&#252;ngliche Nachricht<br /></div>')
Esempio n. 37
0
 def test_get_cc(self):
     msg = mbox_email(self.open_msg('msg1.txt'))
     self.assertEqual(msg.getCC(), [('', '*****@*****.**')])
Esempio n. 38
0
 def test_list_attachments(self):
     msg = mbox_email(self.open_msg('msg1.txt'))
     self.assertEqual(msg.getAttachments(), ['test.png'])
Esempio n. 39
0
 def test_get_cc_with_encoding(self):
     msg = mbox_email(self.open_msg('msg2.txt'))
     self.assertEqual(msg.getCC(),
                      [(u'Aur&#233;lien Camp&#233;as', '*****@*****.**')])
Esempio n. 40
0
 def test_get_message_id(self):
     msg = mbox_email(self.open_msg('msg1.txt'))
     self.assertEqual(msg.getMessageID(), '<*****@*****.**>')
Esempio n. 41
0
 def test_get_in_reply_to(self):
     msg = mbox_email(self.open_msg('msg1.txt'))
     self.assertEqual(msg.getInReplyTo(), '<*****@*****.**>')
Esempio n. 42
0
 def test_list_multiple_attachments(self):
     msg = mbox_email(self.open_msg('msg3.txt'))
     self.assertEqual(msg.getAttachments(), ['test.png', 'test.zip'])