示例#1
0
    def test_getAlternateMIMETypesMixed(self):
        """
        Test that there are no alternate MIME types returned by
        L{xquotient.exmess.MessageBodyFragment.getAlternateMIMETypes} for
        L{mixed}
        """
        self.setUpMailStuff()
        m = self.createMIMEReceiver().feedStringNow(self.mixed).message
        messageBody = MessageBodyFragment(m, 'text/plain')

        self.assertEqual(list(messageBody.getAlternateMIMETypes()), [])
示例#2
0
    def test_getAlternateMIMETypesMixed(self):
        """
        Test that there are no alternate MIME types returned by
        L{xquotient.exmess.MessageBodyFragment.getAlternateMIMETypes} for
        L{mixed}
        """
        self.setUpMailStuff()
        m = self.createMIMEReceiver().feedStringNow(
            self.mixed).message
        messageBody = MessageBodyFragment(m, 'text/plain')

        self.assertEqual(
            list(messageBody.getAlternateMIMETypes()), [])
示例#3
0
    def test_alternateMIMETypesAltMixed(self):
        """
        Test that C{text/html} is the only alternate MIME type returned by
        L{xquotient.exmess.MessageBodyFragment.getAlternateMIMETypes} for
        L{altInsideMixed}
        """
        self.setUpMailStuff()
        m = self.createMIMEReceiver().feedStringNow(
            self.altInsideMixed).message
        messageBody = MessageBodyFragment(m, 'text/plain')

        self.assertEqual(list(messageBody.getAlternateMIMETypes()),
                         ['text/html'])
示例#4
0
    def test_alternateMIMETypesAltMixed(self):
        """
        Test that C{text/html} is the only alternate MIME type returned by
        L{xquotient.exmess.MessageBodyFragment.getAlternateMIMETypes} for
        L{altInsideMixed}
        """
        self.setUpMailStuff()
        m = self.createMIMEReceiver().feedStringNow(
            self.altInsideMixed).message
        messageBody = MessageBodyFragment(m, 'text/plain')

        self.assertEqual(
            list(messageBody.getAlternateMIMETypes()), ['text/html'])