def testEscapedStrings(self): strings = { r"Test with one \ slash character": r"Test with one \\ slash character", r"Test with two \\ slash characters": r"Test with two \\\\ slash characters", r"Retirer les caractères d’échappement \\xNN ?": r"Retirer les caractères d’échappement \\\\xNN ?", r"Test with unescaped single 'quotes'": r"Test with unescaped single \'quotes\'", r"Test with escaped single \'quotes\'": r"Test with escaped single \\\'quotes\\\'", r"To \"Open multiple links\", please enable the \'Draw over other apps\' permission for &brandShortName;": r"To \\"Open multiple links\\", please enable the \\\'Draw over other apps\\\' permission for &brandShortName;", } for string, result in strings.iteritems(): self.assertEqual(escape(string), result)
def testCleanStrings(self): strings = {"This is a simple test.": "This is a simple test.", "您的電腦中已儲存下列的 Cookie:": "您的電腦中已儲存下列的 Cookie:"} for string, result in strings.iteritems(): self.assertEqual(escape(string), result)