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