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

Method test_mail_message2

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

Source from the content-addressed store, hash-verified

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:
935 return
936 # Test if we can download some mail attachments.
937 # Set query2 to a mail subject of a spam e-mail you know contains an attachment.
938 m = web.Mail(self.username, self.password, service=self.service, port=self.port, secure=self.SSL)
939 if "spam" in m.folders:
940 for id in m.spam.search(self.query2, field=web.SUBJECT):
941 e = m.spam.read(id, attachments=True, cached=False)
942 if len(e.attachments) > 0:
943 self.assertTrue(isinstance(e.attachments[0][1], str))
944 self.assertTrue(len(e.attachments[0][1]) > 0)
945 print "pattern.web.Message.attachments (MIME-type: %s)" % e.attachments[0][0]
946 print "pattern.web.Mail.search(field=SUBJECT)"
947 print "pattern.web.Mail.read()"
948
949#---------------------------------------------------------------------------------------------------
950

Callers

nothing calls this directly

Calls 3

lenFunction · 0.85
searchMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected