def test_plain_code_leading_whitespace(self): """ Whitespace on the first line is retained. """ input = ' vär=1' expected = '<span class="plain"> vär=1</span>' value = PlainCodeHighlighter().highlight(input) self.assertEqual(value, expected)
def test_plain_code(self): """ PLAIN_CODE is not run through Pygments, test it separately. """ input = 'vär' expected = '<span class="plain">vär</span>' value = PlainCodeHighlighter().highlight(input) self.assertEqual(value, expected)
def test_plain_code_leading_whitespace_multiline(self): """ Whitespace on the first line is retained, also on subsequent lines. """ input = ' vär=1\n' ' vär=2\n' ' vär=3\n' ' vär=4' expected = ('<span class="plain"> vär=1</span>\n' '<span class="plain"> vär=2</span>\n' '<span class="plain"> vär=3</span>\n' '<span class="plain"> vär=4</span>') value = PlainCodeHighlighter().highlight(input) self.assertEqual(value, expected)