示例#1
0
 def test_search_and_replace_notfound_two(self):
     result = search_replace.search_and_replace("I am Batman", "Robin", "!!",0)
     self.assertEqual(result,"ERROR: The substring entered is not found.")
示例#2
0
 def test_search_and_replace_end_two(self):
     result = search_replace.search_and_replace("I am Batman", "man", "!!",0)
     self.assertEqual(result,"I am Bat!!")
示例#3
0
 def test_search_and_replace_notfound_one(self):
     result = search_replace.search_and_replace("Hello World!", "lde", "@@",0)
     self.assertEqual(result,"ERROR: The substring entered is not found.")
示例#4
0
 def test_search_and_replace_end_one(self):
     result = search_replace.search_and_replace("Hello World!", "ld!", "@@",0)
     self.assertEqual(result,"Hello Wor@@")
示例#5
0
 def test_search_and_replace_middle_two(self):
     result = search_replace.search_and_replace("I am Batman", "am", "!!",0)
     self.assertEqual(result,"I !! Batman")
示例#6
0
 def test_search_and_replace_middle_one(self):
     result = search_replace.search_and_replace("Hello World!", "llo", "@@",0)
     self.assertEqual(result,"He@@ World!")
示例#7
0
 def test_search_and_replace_beginning_two(self):
     result = search_replace.search_and_replace("I am Batman", "I", "!!", 0)
     self.assertEqual(result, "!! am Batman")
示例#8
0
 def test_search_and_replace_beginning_one(self):
     result = search_replace.search_and_replace("Hello World!", "Hel", "@@", 0)
     self.assertEqual(result, "@@lo World!")