Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 def test_highlight_one_word_match(self):
     hl = highlightContains("test", "test")
     expected = self.expectedHighlight("test")
     self.assertEquals(expected, hl)
Exemplo n.º 3
0
 def test_highlight_empty(self):
     self.assertEquals("test", highlightContains("test",""))
Exemplo n.º 4
0
 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)
Exemplo n.º 5
0
 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)