예제 #1
0
    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)
예제 #2
0
    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)
예제 #3
0
    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')
예제 #4
0
    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')