def _create_lambda_from_s3(self):
zip_file = MockZipFile.create_zip("test")
bucket_name = "test_bucket"
s3 = boto3.resource('s3')
bucket = s3.Bucket(bucket_name)
bucket.create()
bucket.put_object(
Key=zip_file,
Body=MockZipFile.read_file(zip_file)
)
self.lambda_conf["Code"] = {'S3Bucket': bucket_name,
'S3Key': zip_file}
response = self.deploy.remote_create_lambada(**self.lambda_conf)
self.assertEqual(response["ResponseMetadata"]["HTTPStatusCode"], 201)
for key in ["FunctionName", "Role", "Runtime", "Handler"]:
self.assertEqual(response[key], self.lambda_conf[key])
return response
评论列表
文章目录