本文整理匯總了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'])