def testLifeCycle(self):
    self.init(__name__ + ".test_handler_yield_keys",
              output_writer_spec=__name__ + ".ShardLifeCycleOutputWriter")

    e1 = TestEntity()
    e1.put()

    self._handle_request()
    expected_events = [
        "create-1",
        "begin_shard-mapreduce0-1",
        "begin_slice-0",
        "write-agd0ZXN0YXBwchALEgpUZXN0RW50aXR5GAEM",
        "end_slice-0",
        "begin_slice-1",
        "end_slice-1",
        "end_shard-mapreduce0-1",
        "finalize-1"
    ]
    self.assertEquals(expected_events, ShardLifeCycleOutputWriter.events)
Tests life cycle methods are called.
dataset/ETHPy150Open GoogleCloudPlatform/appengine-mapreduce/python/test/mapreduce/handlers_test.py/MapperWorkerCallbackHandlerTest.testLifeCycle