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


Python AuroraClientAPI._scheduler_proxy方法代码示例

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


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

示例1: test_handles_api_auth_error

# 需要导入模块: from apache.aurora.client.api import AuroraClientAPI [as 别名]
# 或者: from apache.aurora.client.api.AuroraClientAPI import _scheduler_proxy [as 别名]
def test_handles_api_auth_error():
    context = AuroraCommandContext()

    mock_scheduler_proxy = mock.create_autospec(spec=SchedulerProxyApiSpec, instance=True)
    mock_scheduler_proxy.killTasks.side_effect = SchedulerProxy.AuthError()

    mock_api = AuroraClientAPI(TEST_CLUSTER, "user-agent")
    mock_api._scheduler_proxy = mock_scheduler_proxy

    context.apis = {TEST_CLUSTER.name: mock_api}
    api = context.get_api(TEST_CLUSTER.name, clusters={TEST_CLUSTER.name: TEST_CLUSTER})

    with pytest.raises(Context.CommandError) as e:
        api.kill_job(AuroraJobKey(TEST_CLUSTER.name, "role", "env", "job"))

    assert e.value.code == EXIT_AUTH_ERROR
    assert mock_scheduler_proxy.killTasks.call_count == 1
开发者ID:bmhatfield,项目名称:aurora,代码行数:19,代码来源:test_context.py

示例2: mock_api

# 需要导入模块: from apache.aurora.client.api import AuroraClientAPI [as 别名]
# 或者: from apache.aurora.client.api.AuroraClientAPI import _scheduler_proxy [as 别名]
 def mock_api(cls):
   api = AuroraClientAPI(Cluster(name="foo"), 'test-client')
   mock_proxy = create_autospec(spec=SchedulerProxyApiSpec, spec_set=True, instance=True)
   api._scheduler_proxy = mock_proxy
   return api, mock_proxy
开发者ID:apache,项目名称:aurora,代码行数:7,代码来源:test_api.py

示例3: mock_api

# 需要导入模块: from apache.aurora.client.api import AuroraClientAPI [as 别名]
# 或者: from apache.aurora.client.api.AuroraClientAPI import _scheduler_proxy [as 别名]
 def mock_api(cls):
     api = AuroraClientAPI(Cluster(name="foo"))
     mock_proxy = Mock()
     api._scheduler_proxy = mock_proxy
     return api, mock_proxy
开发者ID:kevints,项目名称:aurora,代码行数:7,代码来源:test_api.py


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