Esempio n. 1
0
 def test_paragraphRendererReplacesIllegalChars(self):
     """
     Test that L{xquotient.renderers.ParagraphRenderer} replaces
     XML-illegal characters in the content of the paragraph it is passed
     """
     para = mimepart.FixedParagraph.fromString('\x00 hi!')
     rend = renderers.ParagraphRenderer(para)
     self.assertEqual(renderPlainFragment(rend).strip(), '0x0 hi!')
 def test_paragraphRendererReplacesIllegalChars(self):
     """
     Test that L{xquotient.renderers.ParagraphRenderer} replaces
     XML-illegal characters in the content of the paragraph it is passed
     """
     para = mimepart.FixedParagraph.fromString('\x00 hi!')
     rend = renderers.ParagraphRenderer(para)
     self.assertEqual(renderPlainFragment(rend).strip(), '0x0 hi!')
Esempio n. 3
0
 def test_paragraphRendererPreservesWhitespace(self):
     self.assertEqual(
         renderPlainFragment(
             renderers.ParagraphRenderer(
                 mimepart.FixedParagraph.fromString('  foo'))).strip(),
         '  foo')
Esempio n. 4
0
 def _renderQuotedMessage(self, levels):
     text = '\n'.join(('>' * i) + str(i) for i in xrange(levels))
     return renderPlainFragment(
                 renderers.ParagraphRenderer(
                     mimepart.FlowedParagraph.fromRFC2646(text)))
Esempio n. 5
0
 def assertRenderedEquals(input, output):
     renderer = renderers.SpacePreservingStringRenderer(input)
     self.assertEqual(renderPlainFragment(renderer), output)
 def test_paragraphRendererPreservesWhitespace(self):
     self.assertEqual(
         renderPlainFragment(
             renderers.ParagraphRenderer(
                 mimepart.FixedParagraph.fromString('  foo'))).strip(),
         '  foo')
 def _renderQuotedMessage(self, levels):
     text = '\n'.join(('>' * i) + str(i) for i in xrange(levels))
     return renderPlainFragment(
         renderers.ParagraphRenderer(
             mimepart.FlowedParagraph.fromRFC2646(text)))
 def assertRenderedEquals(input, output):
     renderer = renderers.SpacePreservingStringRenderer(input)
     self.assertEqual(renderPlainFragment(renderer), output)