test_ApplicationAutoscaling.py 文件源码

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

项目:deployfish 作者: caltechads 项目源码 文件源码
def setUp(self):
        aws_data = {
            'ScalableTargets': [
                {
                    'ServiceNamespace': 'ecs',
                    'ResourceId': 'service/my_cluster/my_service',
                    'ScalableDimension': 'ecs:service:DesiredCount',
                    'MinCapacity': 1,
                    'MaxCapacity': 3,
                    'RoleARN': 'my_role_arn',
                    'CreationTime': datetime(2017, 4, 14)
                }
            ],
            'NextToken': None
        }
        init = Mock(return_value=None)
        init.return_value = None
        appscaling_client = Mock()
        appscaling_client.describe_scalable_targets = Mock(return_value=aws_data)
        client = Mock(return_value=appscaling_client)
        with Replacer() as r:
            r.replace('boto3.client', client)
            r.replace('deployfish.aws.appscaling.ScalingPolicy.__init__', init)
            self.appscaling = ApplicationAutoscaling('my_service', 'my_cluster')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号