def testLimitingRate(self):
    e1 = TestEntity()
    e1.put()

    e2 = TestEntity()
    e2.put()

    e3 = TestEntity()
    e3.put()

    # Everytime the handler is called, it increases time by this amount.
    TestHandler.delay = parameters.config._SLICE_DURATION_SEC/2 - 1
    # handler should be called twice.
    self.init(mapper_parameters={
        "processing_rate": 10.0/parameters.config._SLICE_DURATION_SEC},
              shard_count=5)

    self.handler.post()

    self.assertEquals(2, len(TestHandler.processed_keys))
    self.verify_shard_state(
        model.ShardState.get_by_shard_id(self.shard_id),
        active=True, processed=2,
        result_status=None)

    tasks = self.taskqueue.GetTasks("default")
    self.assertEquals(1, len(tasks))
    self.assertEquals(tasks[0]["eta_delta"], "0:00:02 from now")
Initializes this class.
dataset/ETHPy150Open GoogleCloudPlatform/appengine-mapreduce/python/test/mapreduce/handlers_test.py/MapperWorkerCallbackHandlerTest.testLimitingRate--crossover with--dataset/ETHPy150Open ganeti/ganeti/lib/cli.py/_RunWhileDaemonsStoppedHelper.__init__