示例#1
0
 def test_result_merge(self):
     c = ResultContainer()
     c.extend('wikipedia', [fake_result()])
     c.extend('wikidata',
              [fake_result(),
               fake_result(url='https://example.com/')])
     self.assertEqual(c.results_length(), 2)
示例#2
0
 def test_result_merge(self):
     c = ResultContainer()
     c.extend('wikipedia', [fake_result()])
     c.extend('wikidata', [fake_result(), fake_result(url='https://example.com/')])
     self.assertEqual(c.results_length(), 2)
示例#3
0
 def test_one_suggestion(self):
     c = ResultContainer()
     c.extend('wikipedia', [fake_result(suggestion=True)])
     self.assertEqual(len(c.suggestions), 1)
     self.assertEqual(c.results_length(), 0)
示例#4
0
 def test_one_result(self):
     c = ResultContainer()
     c.extend('wikipedia', [fake_result()])
     self.assertEqual(c.results_length(), 1)