MCPcopy Index your code
hub / github.com/clips/pattern / test_mail_message1

Method test_mail_message1

test/test_web.py:912–931  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

910 print "pattern.web.Mail"
911
912 def test_mail_message1(self):
913 if not self.username or not self.password or not self.query1:
914 return
915 # Assert web.imap.Mailfolder.search().
916 m = web.Mail(self.username, self.password, service=self.service, port=self.port, secure=self.SSL)
917 a = m.inbox.search(self.query1, field=web.FROM)
918 self.assertTrue(isinstance(a[0], int))
919 # Assert web.imap.Mailfolder.read().
920 e = m.inbox.read(a[0], attachments=False, cached=False)
921 # Assert web.imap.Message.
922 self.assertTrue(isinstance(e, web.imap.Message))
923 self.assertTrue(isinstance(e.author, unicode))
924 self.assertTrue(isinstance(e.email_address, unicode))
925 self.assertTrue(isinstance(e.date, unicode))
926 self.assertTrue(isinstance(e.subject, unicode))
927 self.assertTrue(isinstance(e.body, unicode))
928 self.assertTrue(self.query1 in e.author.lower())
929 self.assertTrue("@" in e.email_address)
930 print "pattern.web.Mail.search(field=FROM)"
931 print "pattern.web.Mail.read()"
932
933 def test_mail_message2(self):
934 if not self.username or not self.password or not self.query2:

Callers

nothing calls this directly

Calls 2

searchMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected