From 17184b451df1f8b0c79a15ad299ecf9bdd5f92f4 Mon Sep 17 00:00:00 2001 From: Andrew Pinkham Date: Tue, 6 May 2014 15:34:29 -0500 Subject: RTF Formatter: added footer test. --- tests/test_rtf_formatter.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_rtf_formatter.py b/tests/test_rtf_formatter.py index 2a80e618..f6e3d964 100644 --- a/tests/test_rtf_formatter.py +++ b/tests/test_rtf_formatter.py @@ -15,6 +15,7 @@ from pygments.formatters import RtfFormatter from pygments.lexers.special import TextLexer class RtfFormatterTest(StringTests, unittest.TestCase): + foot = (r'\par' '\n' r'}') def format_rtf(self, t): tokensource = list(TextLexer().get_tokens(t)) @@ -31,6 +32,12 @@ class RtfFormatterTest(StringTests, unittest.TestCase): expected = r'{\rtf1\ansi\uc0' self.assertStartsWith(result, expected) + def test_rtf_footer(self): + t = u'' + result = self.format_rtf(t) + expected = self.foot + self.assertEndsWith(result, expected) + def test_ascii_characters(self): t = u'a b c d ~' result = self.format_rtf(t) -- cgit v1.2.1