本文整理汇总了Python中disco_aws_automation.DiscoAWS.instances_from_asgs方法的典型用法代码示例。如果您正苦于以下问题:Python DiscoAWS.instances_from_asgs方法的具体用法?Python DiscoAWS.instances_from_asgs怎么用?Python DiscoAWS.instances_from_asgs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类disco_aws_automation.DiscoAWS
的用法示例。
在下文中一共展示了DiscoAWS.instances_from_asgs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_instances_from_amis_with_group_name
# 需要导入模块: from disco_aws_automation import DiscoAWS [as 别名]
# 或者: from disco_aws_automation.DiscoAWS import instances_from_asgs [as 别名]
def test_instances_from_amis_with_group_name(self, mock_config, **kwargs):
'''test get instances using ami ids in a specified group name'''
aws = DiscoAWS(config=mock_config, environment_name=TEST_ENV_NAME)
instance = create_autospec(boto.ec2.instance.Instance)
instance.id = "i-123123aa"
instances = [instance]
aws.instances_from_asgs = MagicMock(return_value=instances)
aws.instances = MagicMock(return_value=instances)
self.assertEqual(aws.instances_from_amis('ami-12345678', group_name='test_group'), instances)
aws.instances_from_asgs.assert_called_with(['test_group'])