Ejemplo n.º 1
0
 def test_add_result_IncreasesResultSize(self):
     live_search = LiveSearch(TEST_TARGET_ID)
     results = live_search.get_results()
     self.assertEquals(0, len(results))
     live_search.add_results([5])
     results = live_search.get_results()
     self.assertEquals(1, len(results))
Ejemplo n.º 2
0
 def test_register_listener_FiresListenerOnCompletion(self):
     self.call_count = 0
     live_search = LiveSearch(TEST_TARGET_ID)
     live_search.register_listener(self._listener)
     live_search.add_results([99,100])
     live_search.mark_completed()
     # one call for results,
     # one call for completion
     self.assertEquals(2, self.call_count)
Ejemplo n.º 3
0
 def test_register_listener_FiresListenerOnAdd(self):
     self.call_count = 0
     live_search = LiveSearch(TEST_TARGET_ID)
     live_search.register_listener(self._listener)
     live_search.add_results([1,2,3,4])
     self.assertEquals(1, self.call_count)