コード例 #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!")