def testHugeTaskUseDatastore(self):
    input_data = [str(i) for i in range(100)]

    bucket_name = "testbucket"
    test_filename = "testfile"
    full_filename = "/%s/%s" % (bucket_name, test_filename)

    with cloudstorage.open(full_filename, mode="w") as f:
      with records.RecordsWriter(f) as w:
        for record in input_data:
          w.write(record)

    control.start_map(
        "test_map",
        __name__ + ".TestHandler",
        input_readers.__name__ + ".GoogleCloudStorageRecordInputReader",
        {
            "input_reader": {
                "bucket_name": bucket_name,
                "objects": [test_filename],
                # the parameter can't be compressed and wouldn't fit into
                # taskqueue payload
                "huge_parameter": random_string(900000)
            }
        },
        shard_count=4,
        base_path="/mapreduce_base_path")

    test_support.execute_until_empty(self.taskqueue)
    self.assertEquals(100, len(TestHandler.processed_entites))
    self.assertEquals([], model._HugeTaskPayload.all().fetch(100))
Test map job with huge parameter values.
dataset/ETHPy150Open GoogleCloudPlatform/appengine-mapreduce/python/test/mapreduce/end_to_end_test.py/EndToEndTest.testHugeTaskUseDatastore