本文整理匯總了Python中apache.aurora.config.AuroraConfig.pick方法的典型用法代碼示例。如果您正苦於以下問題:Python AuroraConfig.pick方法的具體用法?Python AuroraConfig.pick怎麽用?Python AuroraConfig.pick使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類apache.aurora.config.AuroraConfig
的用法示例。
在下文中一共展示了AuroraConfig.pick方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_pick
# 需要導入模塊: from apache.aurora.config import AuroraConfig [as 別名]
# 或者: from apache.aurora.config.AuroraConfig import pick [as 別名]
def test_pick():
env = AuroraConfigLoader.load(BytesIO(MESOS_CONFIG))
hello_world = env['jobs'][0]
assert AuroraConfig.pick(env, 'hello_world', None) == hello_world
env['jobs'][0] = env['jobs'][0](name='something_{{else}}')
assert str(AuroraConfig.pick(env, 'something_else', [{'else': 'else'}]).name()) == (
'something_else')
示例2: test_pick
# 需要導入模塊: from apache.aurora.config import AuroraConfig [as 別名]
# 或者: from apache.aurora.config.AuroraConfig import pick [as 別名]
def test_pick():
with temporary_file() as fp:
fp.write(MESOS_CONFIG)
fp.flush()
env = AuroraConfigLoader.load(fp.name)
hello_world = env['jobs'][0]
assert AuroraConfig.pick(env, 'hello_world', None) == hello_world
env['jobs'][0] = env['jobs'][0](name='something_{{else}}')
assert str(AuroraConfig.pick(env, 'something_else', [{'else': 'else'}]).name()) == (
'something_else')