本文整理汇总了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)
示例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)
示例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)