def testScheduleSlice_Hooks(self):
    hooks_class_name = __name__ + '.' + TestHooks.__name__
    self.init(hooks_class_name=hooks_class_name)

    self.handler._schedule_slice(self.shard_state, self.transient_state)

    self.assertEquals(1, len(self.taskqueue.GetTasks("default")))
    self.assertEquals(1, len(TestHooks.enqueue_worker_task_calls))
    task, queue_name = TestHooks.enqueue_worker_task_calls[0]
    self.assertEquals("/mapreduce/worker_callback/" + self.shard_state.shard_id,
                      task.url)
    self.assertEquals("default", queue_name)
Test _schedule_slice method with a hooks class installed.
dataset/ETHPy150Open GoogleCloudPlatform/appengine-mapreduce/python/test/mapreduce/handlers_test.py/MapperWorkerCallbackHandlerTest.testScheduleSlice_Hooks