本文整理匯總了Python中apache.aurora.config.AuroraConfig.environment方法的典型用法代碼示例。如果您正苦於以下問題:Python AuroraConfig.environment方法的具體用法?Python AuroraConfig.environment怎麽用?Python AuroraConfig.environment使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類apache.aurora.config.AuroraConfig
的用法示例。
在下文中一共展示了AuroraConfig.environment方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_inject_default_environment
# 需要導入模塊: from apache.aurora.config import AuroraConfig [as 別名]
# 或者: from apache.aurora.config.AuroraConfig import environment [as 別名]
def test_inject_default_environment():
base_job = Job(
name='hello_world', role='john_doe', cluster='smf1-test',
task=Task(name='main', processes=[],
resources=Resources(cpu=0.1, ram=64 * MB, disk=64 * MB)))
no_env_config = AuroraConfig(base_job)
config._inject_default_environment(no_env_config)
assert no_env_config.environment() == DEFAULT_ENVIRONMENT
test_env_config = AuroraConfig(base_job(environment='test'))
config._inject_default_environment(test_env_config)
assert test_env_config.environment() == 'test'
示例2: test_inject_default_environment
# 需要導入模塊: from apache.aurora.config import AuroraConfig [as 別名]
# 或者: from apache.aurora.config.AuroraConfig import environment [as 別名]
def test_inject_default_environment():
base_job = Job(
name="hello_world",
role="john_doe",
cluster="test-cluster",
task=Task(name="main", processes=[], resources=Resources(cpu=0.1, ram=64 * MB, disk=64 * MB)),
)
no_env_config = AuroraConfig(base_job)
config._inject_default_environment(no_env_config)
assert no_env_config.environment() == DEFAULT_ENVIRONMENT
test_env_config = AuroraConfig(base_job(environment="test"))
config._inject_default_environment(test_env_config)
assert test_env_config.environment() == "test"