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


Python AppEngineHelper.get_appengine_web_xml_location方法代码示例

本文整理汇总了Python中appengine_helper.AppEngineHelper.get_appengine_web_xml_location方法的典型用法代码示例。如果您正苦于以下问题:Python AppEngineHelper.get_appengine_web_xml_location方法的具体用法?Python AppEngineHelper.get_appengine_web_xml_location怎么用?Python AppEngineHelper.get_appengine_web_xml_location使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在appengine_helper.AppEngineHelper的用法示例。


在下文中一共展示了AppEngineHelper.get_appengine_web_xml_location方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_upload_java_app_with_no_appid

# 需要导入模块: from appengine_helper import AppEngineHelper [as 别名]
# 或者: from appengine_helper.AppEngineHelper import get_appengine_web_xml_location [as 别名]
  def test_upload_java_app_with_no_appid(self):
    # if the user gives us an app with a reserved appid, we should abort

    # add in mocks so that there is an appengine-web.xml, but with no appid set
    flexmock(os.path)
    os.path.should_call('exists')
    os.path.should_receive('exists').with_args(
      AppEngineHelper.get_app_yaml_location(self.app_dir)).and_return(False)
    appengine_web_xml_location = AppEngineHelper.get_appengine_web_xml_location(
      self.app_dir)
    os.path.should_receive('exists').with_args(
      AppEngineHelper.get_appengine_web_xml_location(self.app_dir)).and_return(True)

    # mock out reading the app.yaml file
    builtins = flexmock(sys.modules['__builtin__'])
    builtins.should_call('open')  # set the fall-through

    fake_appengine_web_xml = flexmock(name="fake_appengine_web_xml")
    fake_appengine_web_xml.should_receive('read').and_return("<baz></baz>\n" +
      "<application></application>")
    builtins.should_receive('open').with_args(appengine_web_xml_location, 'r') \
      .and_return(fake_appengine_web_xml)

    argv = [
      "--keyname", self.keyname,
      "--file", self.app_dir
    ]
    options = ParseArgs(argv, self.function).args
    self.assertRaises(AppEngineConfigException, AppScaleTools.upload_app, options)
开发者ID:DrOctogon,项目名称:appscale-tools,代码行数:31,代码来源:test_appscale_upload_app.py

示例2: test_upload_java_app_with_no_appid

# 需要导入模块: from appengine_helper import AppEngineHelper [as 别名]
# 或者: from appengine_helper.AppEngineHelper import get_appengine_web_xml_location [as 别名]
  def test_upload_java_app_with_no_appid(self):
    # add in mocks so that there is an appengine-web.xml, but with no appid set
    flexmock(os.path)
    os.path.should_call('exists')
    os.path.should_receive('exists').with_args(
      AppEngineHelper.get_app_yaml_location(self.app_dir)).and_return(False)
    appengine_web_xml_location = AppEngineHelper.get_appengine_web_xml_location(
      self.app_dir)
    os.path.should_receive('exists').with_args(
      AppEngineHelper.get_appengine_web_xml_location(self.app_dir)).and_return(True)
    flexmock(AppEngineHelper).should_receive('get_app_id_from_app_config').and_return('app_id')
    flexmock(AppEngineHelper).should_receive('get_app_runtime_from_app_config').and_return('runtime')
    flexmock(LocalState).should_receive('get_secret_key').and_return()
    flexmock(AppControllerClient).should_receive('get_uaserver_host').and_return('1.2.3.4')

    # mock out reading the app.yaml file
    builtins = flexmock(sys.modules['__builtin__'])
    builtins.should_call('open')  # set the fall-through

    fake_appengine_web_xml = flexmock(name="fake_appengine_web_xml")
    fake_appengine_web_xml.should_receive('read').and_return("<baz></baz>\n" +
      "<application></application>")
    builtins.should_receive('open').with_args(appengine_web_xml_location, 'r') \
      .and_return(fake_appengine_web_xml)

    argv = [
      "--keyname", self.keyname,
      "--file", self.app_dir
    ]
    options = ParseArgs(argv, self.function).args
    self.assertRaises(AppEngineConfigException, AppScaleTools.upload_app, options)
开发者ID:Git-Host,项目名称:appscale-tools,代码行数:33,代码来源:test_appscale_upload_app.py

示例3: test_upload_app_with_no_app_yaml_or_appengine_web_xml

# 需要导入模块: from appengine_helper import AppEngineHelper [as 别名]
# 或者: from appengine_helper.AppEngineHelper import get_appengine_web_xml_location [as 别名]
  def test_upload_app_with_no_app_yaml_or_appengine_web_xml(self):
    # all app engine apps must have a config file - abort if we can't find one

    # add in mocks so that the config files aren't found
    flexmock(os.path)
    os.path.should_call('exists')
    os.path.should_receive('exists').with_args(
      AppEngineHelper.get_app_yaml_location(self.app_dir)).and_return(False)
    os.path.should_receive('exists').with_args(
      AppEngineHelper.get_appengine_web_xml_location(self.app_dir)) \
      .and_return(False)

    argv = [
      "--keyname", self.keyname,
      "--file", self.app_dir
    ]
    options = ParseArgs(argv, self.function).args
    self.assertRaises(AppEngineConfigException, AppScaleTools.upload_app, options)
开发者ID:DrOctogon,项目名称:appscale-tools,代码行数:20,代码来源:test_appscale_upload_app.py


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