def testEscape(self): raw = 'text_with_underscores *and stars*' expected = 'text\\_with\\_underscores \\*and stars\\*' actual = markdown.md_escape(raw) self.assertEquals(expected, actual)