

@unittest.skipUnless(RUN_INDEXES, 'RUN_INDEXES is 0')
def test_index_return_terms(self):
    if (not self.is_2i_supported()):
        raise unittest.SkipTest('2I is not supported')
    (bucket, o1, o2, o3, o4) = self._create_index_objects()
    pairs = bucket.get_index('field1_bin', 'val2', 'val4', return_terms=True)
    self.assertEqual([('val2', o2.key), ('val3', o3.key), ('val4', o4.key)], sorted(pairs))
    spairs = []
    for chunk in bucket.stream_index('field2_int', 1002, 1004, return_terms=True):
        spairs.extend(chunk)
    self.assertEqual([(1002, o2.key), (1003, o3.key), (1004, o4.key)], sorted(spairs))

dataset/ETHPy150Open basho/riak-python-client/riak/tests/test_2i.py TwoITests.test_index_return_terms/original