def test_escape_LongString_EscapeSubStr_MixedPercents_ButtingUp(self): message = "X%X%helloX%XhelloX%X%X%X" escape_string = "hello" expectResult = "X%25X%25%68%65%6c%6c%6fX%25X%68%65%6c%6c%6fX%25X%25X%25X" result = Escape.escape(message,escape_string) self.assertEqual(expectResult, result)
def test_escape_LongString_ManyEscapePercents(self): message = "XXX%XXXXXXXXXXXXX%XXXXXXXXXXXXXXXX%XXXXXXXXXXXXXXXXXXX%XXXXXXXXXXXXXXXXX%XXXXXXXXXXXXXX" expectResult = "XXX%25XXXXXXXXXXXXX%25XXXXXXXXXXXXXXXX%25XXXXXXXXXXXXXXXXXXX%25XXXXXXXXXXXXXXXXX%25XXXXXXXXXXXXXX" result = Escape.escape(message) self.assertEqual(expectResult, result)
def test_escape_LongString_EscapeSubStr(self): message = "XXXXhelloXXXX" expectResult = "XXXX%68%65%6c%6c%6fXXXX" escape_string = "hello" result = Escape.escape(message,escape_string) self.assertEqual(expectResult, result)
def test_escape_nonEmptyStringNoEscapeNeeded(self): message = "XXXXXX" expectResult = message result = Escape.escape(message) self.assertEqual(expectResult, result)
def test_escape_nonEmptyString_EscapePercent(self): message = "XXX%XXX" expectResult = "XXX%25XXX" result = Escape.escape(message) self.assertEqual(expectResult, result)
def test_escape_LongString_EscapeSubStr_MixedPercents_ButtingUp(self): message = "X%X%helloX%XhelloX%X%X%X" escape_string = "hello" expectResult = "X%25X%25%68%65%6c%6c%6fX%25X%68%65%6c%6c%6fX%25X%25X%25X" result = Escape.escape(message, escape_string) self.assertEqual(expectResult, result)
def test_escape_emptyString(self): message = "" expectResult = message result = Escape.escape(message) self.assertEqual(expectResult, result)
def test_escape_LongString_EscapeSubStr(self): message = "XXXXhelloXXXX" expectResult = "XXXX%68%65%6c%6c%6fXXXX" escape_string = "hello" result = Escape.escape(message, escape_string) self.assertEqual(expectResult, result)