当前位置: 首页>>代码示例>>Python>>正文


Python AppScale.destroy方法代码示例

本文整理汇总了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'])
开发者ID:briandrawert,项目名称:appscale-tools,代码行数:29,代码来源:test_appscale.py

示例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()
开发者ID:briandrawert,项目名称:appscale-tools,代码行数:26,代码来源:test_appscale.py


注:本文中的appscale.AppScale.destroy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。