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', '*****@*****.**')])
def test_get_to_with_wrong_encoding(self): msg = mbox_email(self.open_msg('msg4.txt')) self.assertEqual(msg.getTo(), [('', '*****@*****.**')])
def test_get_to(self): msg = mbox_email(self.open_msg('msg1.txt')) self.assertEqual(msg.getTo(), [(u'John Doe', '*****@*****.**')])
def test_not_attachments(self): msg = mbox_email(self.open_msg('msg2.txt')) self.assertEqual(msg.getAttachments(), [])
def test_list_attachments(self): msg = mbox_email(self.open_msg('msg1.txt')) self.assertEqual(msg.getAttachments(), [('test.png', 'test.png')])
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>')
def test_get_cc_with_wrong_encoding(self): msg = mbox_email(self.open_msg('msg4.txt')) self.assertEqual(msg.getCC(), [('', '*****@*****.**')])
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))
def test_get_subject(self): msg = mbox_email(self.open_msg('msg1.txt')) self.assertEqual(msg.getSubject(), u'Re: test email')
def test_get_from_with_encoding(self): msg = mbox_email(self.open_msg('msg2.txt')) self.assertEqual(msg.getFrom(), (u'Geir Bækholt', '*****@*****.**'))
def test_get_from(self): msg = mbox_email(self.open_msg('msg1.txt')) self.assertEqual(msg.getFrom(), (u'Smith', '*****@*****.**'))
def test_get_to_with_encoding(self): msg = mbox_email(self.open_msg('msg2.txt')) self.assertEqual(msg.getTo(), [(u'Tim Terlegård', '*****@*****.**')])
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)
def test_get_subject_with_encoding(self): msg = mbox_email(self.open_msg('msg2.txt')) self.assertEqual( msg.getSubject(), u'[Zope] FYI:Portallösungen für den Bildungsbereich /' u' Zope Tagung (German)')
def test_get_subject_with_encoding(self): msg = mbox_email(self.open_msg('msg2.txt')) self.assertEqual(msg.getSubject(), u'[Zope] FYI:Portallösungen für den Bildungsbereich / Zope Tagung (German)')
def test_get_subject_with_wrong_encoding(self): msg = mbox_email(self.open_msg('msg4.txt')) self.assertEqual(msg.getSubject(), '')
def test_get_cc(self): msg = mbox_email(self.open_msg('msg1.txt')) self.assertEqual(msg.getCC(), [('', '*****@*****.**')])
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üngliche Nachricht<br /></div>')
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')])
def test_get_cc_with_encoding(self): msg = mbox_email(self.open_msg('msg2.txt')) self.assertEqual(msg.getCC(), [(u'Aurélien Campéas', '*****@*****.**')])
def test_get_in_reply_to(self): msg = mbox_email(self.open_msg('msg1.txt')) self.assertEqual(msg.getInReplyTo(), '<*****@*****.**>')
def test_get_message_id(self): msg = mbox_email(self.open_msg('msg1.txt')) self.assertEqual(msg.getMessageID(), '<*****@*****.**>')
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>')
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üngliche Nachricht<br /></div>')
def test_list_attachments(self): msg = mbox_email(self.open_msg('msg1.txt')) self.assertEqual(msg.getAttachments(), ['test.png'])
def test_list_multiple_attachments(self): msg = mbox_email(self.open_msg('msg3.txt')) self.assertEqual(msg.getAttachments(), ['test.png', 'test.zip'])