Exemple #1
0
 def test_add_page_to_index_with_too_long_word(self):
     indexer = Indexer()
     index = {}
     url = "http://dn.se"
     content = "a brown porcupinesporcupinesporcupinesporcupinesporcupinesporcupines"
     indexer.add_page_to_index(index, url, content)
     self.assertEqual({u'a': [[0, 'http://dn.se']], u'brown': [[1, 'http://dn.se']]}, index)
Exemple #2
0
 def test_add_page_to_index(self):
     indexer = Indexer()
     index = {}
     url = "http://dn.se"
     content = "a brown fox"
     indexer.add_page_to_index(index, url, content)
     self.assertEqual({u'a': [[0, 'http://dn.se']], u'brown': [[1, 'http://dn.se']], u'fox': [[2, 'http://dn.se']]}, index)