Add tests to show entity escaping failures

This commit is contained in:
Matthew Tretter
2012-07-16 12:19:18 -04:00
parent 72d6e6c5ee
commit fac7b4fb8e

View File

@@ -42,6 +42,19 @@ class EscapeTests(unittest.TestCase):
def test_underscore(self):
self.assertEqual(md('_hey_dude_'), '\_hey\_dude\_')
def test_xml_entities(self):
self.assertEqual(md('&'), '&')
def test_named_entities(self):
self.assertEqual(md('»'), u'\xbb')
def test_hexadecimal_entities(self):
# This looks to be a bug in BeautifulSoup (fixed in bs4) that we have to work around.
self.assertEqual(md('''), '\x27')
def test_single_escaping_entities(self):
self.assertEqual(md('&'), '&')
class ConversionTests(unittest.TestCase):