def testEscape(self): self.assertEqual(latex.escape('&'), '\&') self.assertEqual(latex.escape('%'), '\%') self.assertEqual(latex.escape('$'), '\$') self.assertEqual(latex.escape('#'), '\#') self.assertEqual(latex.escape('_'), '\_') self.assertEqual(latex.escape('{'), '\{') self.assertEqual(latex.escape('}'), '\}') self.assertEqual(latex.escape('^'), '\^') self.assertEqual(latex.escape('~'), '\\textasciitilde\\') self.assertEqual(latex.escape('\\'), '\\textbackslash\\') self.assertEqual(latex.escape('<'), '\\textless\\') self.assertEqual(latex.escape('>'), '\\textgreater\\')