예제 #1
0
    def test4(self):
        message = 'dogfood'
        chunk = "goodgooogoogfogoood"
        word = "goo"
#         print message
#         print word
#         print chunk
        result = answer3_1(chunk, word)
#         print result
        self.assertIn(re.sub(word, '', message), result)
예제 #2
0
    def test6(self):
        message = 'lo'
        chunk = "lolol"
        word = "lol"
#         print message
#         print word
#         print chunk
        result = answer3_1(chunk, word)
#         print result
        self.assertIn(re.sub(word, '', message), result)
예제 #3
0
    def test7(self):
        word =    "aabaa"
        message = "rodsjkashsljkasehf"
        numInsertions = 15
        chunk, insertionPoints = create_testcase(message, word, 
                                                 numInsertions = numInsertions,
                                                 insertionPoints = None)
#         print message
#         print word
#         print insertionPoints
#         print chunk
        result = answer3_1(chunk, word)
#         print result
        self.assertIn(re.sub(word, '', message), result)
예제 #4
0
    def test2(self):
        message = "rodsjkasdfhdshsaiehf"
        word =    "rodsjkashdshsljkasehf"
        insertionPoints = None
        numInsertions = 5
        chunk, insertionPoints = create_testcase(message, word, 
                                                 numInsertions = numInsertions,
                                                 insertionPoints = insertionPoints)
#         print message
#         print word
#         print insertionPoints
#         print chunk
        result = answer3_1(chunk, word)
#         print result
        self.assertIn(re.sub(word, '', message), result)
예제 #5
0
    def test3(self):
        word = "g"
        message = ""
        insertionPoints = None
        numInsertions = 5
        chunk, insertionPoints = create_testcase(message, word, 
                                                 numInsertions = numInsertions,
                                                 insertionPoints = insertionPoints)
#         print message
#         print word
#         print insertionPoints
#         print chunk
        result = answer3_1(chunk, word)
#         print result
        self.assertIn(re.sub(word, '', message), result)