def testSmoke(self):
    for _ in range(100):
      TestEntity().put()
    self.handler.post()

    tasks = self.taskqueue.GetTasks(self.QUEUE)
    # Only kickoff task should be there.
    self.assertEquals(1, len(tasks))
    task_mr_id = test_support.decode_task_payload(tasks[0]).get("mapreduce_id")

    # Verify mr id is generated.
    mapreduce_id = self.handler.json_response["mapreduce_id"]
    self.assertTrue(mapreduce_id)
    self.assertEqual(task_mr_id, mapreduce_id)

    # Verify state is created.
    state = model.MapreduceState.get_by_job_id(
        self.handler.json_response["mapreduce_id"])
    self.assertTrue(state)
    self.assertTrue(state.active)
    self.assertEqual(0, state.active_shards)

    # Verify mapreduce spec.
    self.assertEqual(self.HANDLER_SPEC,
                     state.mapreduce_spec.mapper.handler_spec)
    self.assertEqual(self.NAME, state.mapreduce_spec.name)
    self.assertEqual(self.INPUT_READER_SPEC,
                     state.mapreduce_spec.mapper.input_reader_spec)
    self.assertEqual(self.OUTPUT_WRITER_SPEC,
                     state.mapreduce_spec.mapper.output_writer_spec)
    self.assertEqual(int(self.SHARD_COUNT),
                     state.mapreduce_spec.mapper.shard_count)
    self.assertEqual(int(self.PROCESSING_RATE),
                     state.mapreduce_spec.mapper.params["processing_rate"])
    self.assertEqual(self.QUEUE,
                     state.mapreduce_spec.params["queue_name"])
Verifies main execution path of starting scan over several entities.
dataset/ETHPy150Open GoogleCloudPlatform/appengine-mapreduce/python/test/mapreduce/handlers_test.py/StartJobHandlerTest.testSmoke