

@unittest.skipUnless(RUN_INDEXES, 'RUN_INDEXES is 0')
def test_set_index(self):
    if (not self.is_2i_supported()):
        raise unittest.SkipTest('2I not supported')
    bucket = self.client.bucket(self.bucket_name)
    obj = bucket.new('bar', 1)
    self.set_index('bar_int', 1)
    obj.set_index('bar2_int', 1)
    self.assertEqual(2, len(obj.indexes))
    self.assertEqual(set((('bar_int', 1), ('bar2_int', 1))), obj.indexes)
    obj.set_index('bar_int', 3)
    self.assertEqual(2, len(obj.indexes))
    self.assertEqual(set((('bar_int', 3), ('bar2_int', 1))), obj.indexes)
    obj.set_index('bar2_int', 10)
    self.assertEqual(set((('bar_int', 3), ('bar2_int', 10))), obj.indexes)

dataset/ETHPy150Open basho/riak-python-client/riak/tests/test_2i.py TwoITests.test_set_index/VarMisuse@65/97 `obj`->`self`