本文整理汇总了Python中appscale.AppScale.destroy方法的典型用法代码示例。如果您正苦于以下问题:Python AppScale.destroy方法的具体用法?Python AppScale.destroy怎么用?Python AppScale.destroy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类appscale.AppScale
的用法示例。
在下文中一共展示了AppScale.destroy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testDestroyWithEC2EnvironmentVariables
# 需要导入模块: from appscale import AppScale [as 别名]
# 或者: from appscale.AppScale import destroy [as 别名]
def testDestroyWithEC2EnvironmentVariables(self):
# if the user wants us to use their EC2 credentials when running AppScale,
# we should make sure they get set
appscale = AppScale()
# Mock out the actual file reading itself, and slip in a YAML-dumped
# file
contents = {
'infrastructure' : 'ec2',
'machine' : 'ami-ABCDEFG',
'keyname' : 'bookey',
'group' : 'boogroup',
'min' : 1,
'max' : 1,
'EC2_ACCESS_KEY' : 'access key',
'EC2_SECRET_KEY' : 'secret key'
}
yaml_dumped_contents = yaml.dump(contents)
self.addMockForAppScalefile(appscale, yaml_dumped_contents)
# finally, mock out the actual appscale-terminate-instances call
flexmock(AppScaleTools)
AppScaleTools.should_receive('terminate_instances')
appscale.destroy()
self.assertEquals('access key', os.environ['EC2_ACCESS_KEY'])
self.assertEquals('secret key', os.environ['EC2_SECRET_KEY'])
示例2: testDestroyWithCloudAppScalefile
# 需要导入模块: from appscale import AppScale [as 别名]
# 或者: from appscale.AppScale import destroy [as 别名]
def testDestroyWithCloudAppScalefile(self):
# calling 'appscale destroy' with an AppScalefile in the local
# directory should collect any parameters needed for the
# 'appscale-terminate-instances' command and then exec it
appscale = AppScale()
# Mock out the actual file reading itself, and slip in a YAML-dumped
# file
contents = {
'infrastructure' : 'ec2',
'machine' : 'ami-ABCDEFG',
'keyname' : 'bookey',
'group' : 'boogroup',
'verbose' : True,
'min' : 1,
'max' : 1
}
yaml_dumped_contents = yaml.dump(contents)
self.addMockForAppScalefile(appscale, yaml_dumped_contents)
# finally, mock out the actual appscale-terminate-instances call
flexmock(AppScaleTools)
AppScaleTools.should_receive('terminate_instances')
appscale.destroy()