Beispiel #1
0
    def __compareMailMessages(self, mOne, mTwo):
        self.assertNotEqual(mOne, None)
        self.assertNotEqual(mTwo, None)

        self.__compareEmailAddressLists(mOne.toAddress, mTwo.toAddress)
        self.__compareEmailAddressLists(mOne.ccAddress, mTwo.ccAddress)

        self.__compareDateTimes(mOne.dateSent, mTwo.dateSent)

        self.assertEquals(mOne.fromAddress.emailAddress,
                          mTwo.fromAddress.emailAddress)

        self.assertEquals(mOne.subject, mTwo.subject)
        self.assertEquals(mOne.headers['Content-Length'],
                          mTwo.headers['Content-Length'])
        self.assertEquals(mOne.headers['Content-Type'],
                          mTwo.headers['Content-Type'])
        self.assertEquals(mOne.headers['Content-Transfer-Encoding'],
                          mTwo.headers['Content-Transfer-Encoding'])
        self.assertEquals(mOne.headers['Mime-Version'],
                          mTwo.headers['Mime-Version'])
        self.assertEquals(utils.textToUnicode(mOne.body),
                          utils.textToUnicode(mTwo.body))
        self.assertEquals(utils.binaryToData(mOne.rfc2822Message),
                          utils.binaryToData(mTwo.rfc2822Message))
Beispiel #2
0
    def __compareMailMessages(self, mOne, mTwo):
        self.assertNotEqual(mOne, None)
        self.assertNotEqual(mTwo, None)

        self.__compareEmailAddressLists(mOne.toAddress, mTwo.toAddress)
        self.__compareEmailAddressLists(mOne.ccAddress, mTwo.ccAddress)

        self.__compareDateTimes(mOne.dateSent, mTwo.dateSent)

        self.assertEquals(mOne.fromAddress.emailAddress, mTwo.fromAddress.emailAddress)

        self.assertEquals(mOne.subject, mTwo.subject)
        self.assertEquals(mOne.headers['Content-Length'], mTwo.headers['Content-Length'])
        self.assertEquals(mOne.headers['Content-Type'], mTwo.headers['Content-Type'])
        self.assertEquals(mOne.headers['Content-Transfer-Encoding'], mTwo.headers['Content-Transfer-Encoding'])
        self.assertEquals(mOne.headers['Mime-Version'], mTwo.headers['Mime-Version'])
        self.assertEquals(utils.textToUnicode(mOne.body), utils.textToUnicode(mTwo.body))
        self.assertEquals(utils.binaryToData(mOne.rfc2822Message), utils.binaryToData(mTwo.rfc2822Message))
Beispiel #3
0
 def exportToFile(self, path):
     data = utils.binaryToData(self.photoBody)
     out = file(path, "wb")
     out.write(data)
     out.close()
Beispiel #4
0
 def exportToFile(self, path):
     data = utils.binaryToData(self.photoBody)
     out = file(path, "wb")
     out.write(data)
     out.close()