def test_new_counter(self): name = 'test' self.assertEquals(0, store.get_count(name)) for i in range(10): store.incr_count(name) self.assertEquals(10, store.get_count(name)) for i in range(10): store.incr_count(name, 100) self.assertEquals(1010, store.get_count(name))
def test_incr_shards(self): name = 'incr' self.assertEquals(0, store.get_count(name)) for i in range(10): store.incr_count(name) store.incr_counter_shards(name, 100) self.assertEquals(10, store.get_count(name)) for i in range(10): store.incr_count(name, 100) self.assertEquals(1010, store.get_count(name))
def run(self): store.incr_count(self.name, self.delta)