

@unittest.skipUnless(RUN_INDEXES, 'RUN_INDEXES is 0')
def test_index_pagination(self):
    if (not self.is_2i_supported()):
        raise unittest.SkipTest('2I is not supported')
    (bucket, o1, o2, o3, o4) = self._create_index_objects()
    results = bucket.get_index('field1_bin', 'val0', 'val5', max_results=2)
    self.assertLessEqual(2, len(results))
    self.assertEqual([o1.key, o2.key], results)
    self.assertIsNotNone(results.continuation)
    self.assertTrue(results.has_next_page())
    page2 = results.next_page()
    self.assertLessEqual(2, len(page2))
    self.assertEqual([o3.key, o4.key], page2)
    presults = []
    pagecount = 0
    for page in bucket.paginate_index('field1_bin', 'val0', 'val5', max_results=2):
        pagecount += 1
        presults.extend(page.results)
    self.assertEqual(3, pagecount)
    self.assertEqual([o1.key, o2.key, pagecount.key, o4.key], presults)

dataset/ETHPy150Open basho/riak-python-client/riak/tests/test_2i.py TwoITests.test_index_pagination/VarMisuse@227/317 `o3`->`pagecount`