예제 #1
0
 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)
예제 #2
0
 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)
예제 #3
0
 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)
예제 #4
0
 def test_escape_nonEmptyStringNoEscapeNeeded(self):
     message = "XXXXXX"
     expectResult = message
     result = Escape.escape(message)
     self.assertEqual(expectResult, result)
예제 #5
0
 def test_escape_nonEmptyString_EscapePercent(self):
     message = "XXX%XXX"
     expectResult = "XXX%25XXX"
     result = Escape.escape(message)
     self.assertEqual(expectResult, result)
예제 #6
0
 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)
예제 #7
0
 def test_escape_emptyString(self):
     message = ""
     expectResult = message
     result = Escape.escape(message)
     self.assertEqual(expectResult, result)
예제 #8
0
 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)
예제 #9
0
 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)
예제 #10
0
 def test_escape_nonEmptyString_EscapePercent(self):
     message = "XXX%XXX"
     expectResult = "XXX%25XXX"
     result = Escape.escape(message)
     self.assertEqual(expectResult, result)
예제 #11
0
 def test_escape_nonEmptyStringNoEscapeNeeded(self):
     message = "XXXXXX"
     expectResult = message
     result = Escape.escape(message)
     self.assertEqual(expectResult, result)
예제 #12
0
 def test_escape_emptyString(self):
     message = ""
     expectResult = message
     result = Escape.escape(message)
     self.assertEqual(expectResult, result)