def test_query_request_term_search(self): query = DotDict() query.index = 'index_id' query.field = 'field' query.value = 'value' self.discovery.query_term = Mock() self.discovery.query_term.return_value = 'test' retval = self.discovery.query_request(query) self.assertTrue(retval == 'test', '%s' % retval)
def test_query_request_range(self): query = DotDict() query['range'] = {'from':0, 'to':90} query.index = 'index_id' query.field = 'field' self.discovery.query_range = Mock() self.discovery.query_range.return_value = 'test' retval = self.discovery.query_request(query) self.assertTrue(retval == 'test')