當前位置: 首頁>>代碼示例>>Python>>正文


Python AuroraConfig.load方法代碼示例

本文整理匯總了Python中apache.aurora.config.AuroraConfig.load方法的典型用法代碼示例。如果您正苦於以下問題:Python AuroraConfig.load方法的具體用法?Python AuroraConfig.load怎麽用?Python AuroraConfig.load使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在apache.aurora.config.AuroraConfig的用法示例。


在下文中一共展示了AuroraConfig.load方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_simple_config

# 需要導入模塊: from apache.aurora.config import AuroraConfig [as 別名]
# 或者: from apache.aurora.config.AuroraConfig import load [as 別名]
def test_simple_config():
    with temporary_file() as fp:
        fp.write(MESOS_CONFIG)
        fp.flush()
        proxy_config1 = AuroraConfig.load(fp.name)
        proxy_config2 = AuroraConfig.load(fp.name, name="hello_world")
        assert proxy_config1.job()
        assert proxy_config1._job == proxy_config2._job
        assert proxy_config1._job == REIFIED_CONFIG
        assert proxy_config1.name() == "hello_world"
        assert proxy_config1.role() == "john_doe"
        assert proxy_config1.cluster() == "smf1-test"
        assert proxy_config1.ports() == set()
開發者ID:kevinburg,項目名稱:incubator-aurora,代碼行數:15,代碼來源:test_base.py

示例2: test_docker_binding_throws

# 需要導入模塊: from apache.aurora.config import AuroraConfig [as 別名]
# 或者: from apache.aurora.config.AuroraConfig import load [as 別名]
  def test_docker_binding_throws(self, mock_resolve):
    mock_resolve.side_effect = Exception('mock resolve failure')

    binding_helper.unregister_all()
    BindingHelper.register(DockerBindingHelper())

    with temporary_file() as fp:
      fp.write(DOCKER_BINDING_CONFIG)
      fp.flush()
      with CLUSTERS.patch(TEST_CLUSTERS):
        cfg = AuroraConfig.load(fp.name)
        with pytest.raises(Exception):
          binding_helper.apply_all(cfg)
          assert mock_resolve.mock_calls == [call(TEST_CLUSTER, 'some/name', 'some.tag')]
開發者ID:apache,項目名稱:aurora,代碼行數:16,代碼來源:test_docker_helper.py

示例3: test_docker_binding

# 需要導入模塊: from apache.aurora.config import AuroraConfig [as 別名]
# 或者: from apache.aurora.config.AuroraConfig import load [as 別名]
  def test_docker_binding(self, mock_resolve):
    image_reference = 'registry.example.com/some/[email protected]:digest'

    mock_resolve.return_value = image_reference

    binding_helper.unregister_all()
    BindingHelper.register(DockerBindingHelper())

    with temporary_file() as fp:
      fp.write(DOCKER_BINDING_CONFIG)
      fp.flush()
      with CLUSTERS.patch(TEST_CLUSTERS):
        cfg = AuroraConfig.load(fp.name)
        binding_helper.apply_all(cfg)
        assert cfg.job().taskConfig.container.docker.image == image_reference
        assert mock_resolve.mock_calls == [call(TEST_CLUSTER, 'some/name', 'some.tag')]
開發者ID:apache,項目名稱:aurora,代碼行數:18,代碼來源:test_docker_helper.py

示例4: test_empty_config

# 需要導入模塊: from apache.aurora.config import AuroraConfig [as 別名]
# 或者: from apache.aurora.config.AuroraConfig import load [as 別名]
def test_empty_config():
    with pytest.raises(AuroraConfig.InvalidConfig):
        with temporary_file() as fp:
            fp.write(UNDERSPECIFIED_MESOS_CONFIG)
            fp.flush()
            AuroraConfig.load(fp.name)
開發者ID:kevinburg,項目名稱:incubator-aurora,代碼行數:8,代碼來源:test_base.py

示例5: write_and_load_config

# 需要導入模塊: from apache.aurora.config import AuroraConfig [as 別名]
# 或者: from apache.aurora.config.AuroraConfig import load [as 別名]
def write_and_load_config(role):
  with temporary_file() as fp:
    fp.write(GENERIC_CONFIG)
    fp.flush()
    return AuroraConfig.load(fp.name, name='hello_world', select_role=role)
開發者ID:MustafaOrkunAcar,項目名稱:incubator-aurora,代碼行數:7,代碼來源:test_binding_helper.py


注:本文中的apache.aurora.config.AuroraConfig.load方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。