def testOnDropMail(self): file('test.mail', 'wb').write('Subject: foo\r\n\r\nBody\r\n') aTask = task.Task() self.taskList.append(aTask) self.viewer.onDropMail(aTask, 'test.mail') self.assertEqual([attachment.MailAttachment('test.mail')], self.viewer.presentation()[0].attachments())
def onDropMail(self, item, mail, **kwargs): ''' This method is called by the widget when a mail message is dropped on an item. ''' att = attachment.MailAttachment(mail) subject, content = att.read() self._addAttachments([att], item, subject=subject, description=content, **kwargs)
def testTypeImgeIndex_MailAttachment(self): mailAttachment = attachment.MailAttachment('', readMail=lambda location: ('', '')) self.assertIcon('envelope_icon', mailAttachment)
def addMailAttachment(self): self.mailAttachment = attachment.MailAttachment(self.filename, # pylint: disable-msg=W0201 readMail=lambda location: ('', '')) self.addAttachment(self.mailAttachment)