| 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 | |