test_deploy_unit.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:ardy 作者: avara1986 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号