Example #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.")
Example #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!!")
Example #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.")
Example #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@@")
Example #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")
Example #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!")
Example #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")
Example #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!")