def test_highlight_multiple_matches(self): hl = highlightContains("test1 test2 test3 test2 test2", "test2") expected = "test1 test2 test3" expected = "test1 %s test3 %s %s" % (self.expectedHighlight("test2"), self.expectedHighlight("test2"), self.expectedHighlight("test2")) self.assertEquals(expected, hl)
def test_highlight_one_word_match(self): hl = highlightContains("test", "test") expected = self.expectedHighlight("test") self.assertEquals(expected, hl)
def test_highlight_empty(self): self.assertEquals("test", highlightContains("test",""))
def test_highlight_phrase_match(self): hl = highlightContains("test1 test2 test3", "test2 test3") expected = "test1 test2 test3" expected = "test1 %s" % (self.expectedHighlight("test2 test3")) self.assertEquals(expected, hl)
def test_highlight_one_word_in_many(self): hl = highlightContains("test1 test2 test3", "test2") expected = "test1 test2 test3" expected = "test1 %s test3" % (self.expectedHighlight("test2")) self.assertEquals(expected, hl)