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


Python Build._slaves_allocated方法代码示例

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


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

示例1: test_cancel_exits_early_if_build_not_running

# 需要导入模块: from app.master.build import Build [as 别名]
# 或者: from app.master.build.Build import _slaves_allocated [as 别名]
    def test_cancel_exits_early_if_build_not_running(self):
        build = Build(BuildRequest({}))
        build._unstarted_subjobs = Queue()
        slave_mock = Mock()
        build._slaves_allocated = [slave_mock]
        build._status = Mock(return_value=BuildStatus.FINISHED)

        build.cancel()

        self.assertFalse(build._is_canceled, "Build should not be canceled")
        self.assertEqual(slave_mock.teardown.call_count, 0, "Teardown should not have been called")
开发者ID:dncarley,项目名称:ClusterRunner,代码行数:13,代码来源:test_build.py

示例2: test_cancel_depletes_queue_and_sets_canceled

# 需要导入模块: from app.master.build import Build [as 别名]
# 或者: from app.master.build.Build import _slaves_allocated [as 别名]
    def test_cancel_depletes_queue_and_sets_canceled(self):
        build = Build(BuildRequest({}))
        build._unstarted_subjobs = Queue()
        build._unstarted_subjobs.put(1)
        slave_mock = Mock()
        build._slaves_allocated = [slave_mock]

        build.cancel()

        self.assertTrue(build._is_canceled, "Build should've been canceled")
        self.assertTrue(build._unstarted_subjobs.empty(), "Build's unstarted subjobs should've been depleted")
开发者ID:dncarley,项目名称:ClusterRunner,代码行数:13,代码来源:test_build.py

示例3: test_teardown_called_on_slave_when_no_subjobs_remain

# 需要导入模块: from app.master.build import Build [as 别名]
# 或者: from app.master.build.Build import _slaves_allocated [as 别名]
    def test_teardown_called_on_slave_when_no_subjobs_remain(self):
        build = Build(BuildRequest({}))
        slave = Slave('', 1)
        slave.teardown = MagicMock()
        slave.free_executor = MagicMock(return_value=0)
        build._unstarted_subjobs = Queue()
        build._slaves_allocated = [slave]

        build.execute_next_subjob_or_teardown_slave(slave)

        slave.teardown.assert_called_with()
开发者ID:dncarley,项目名称:ClusterRunner,代码行数:13,代码来源:test_build.py

示例4: test_teardown_called_on_slave_when_slave_in_shutdown_mode

# 需要导入模块: from app.master.build import Build [as 别名]
# 或者: from app.master.build.Build import _slaves_allocated [as 别名]
    def test_teardown_called_on_slave_when_slave_in_shutdown_mode(self):
        build = Build(BuildRequest({}))
        slave = Slave('', 1)
        slave.teardown = MagicMock()
        slave._is_in_shutdown_mode = True
        slave.free_executor = MagicMock(return_value=0)
        build._unstarted_subjobs = Queue()
        build._unstarted_subjobs.put(Mock(spec=Subjob))
        build._slaves_allocated = [slave]

        build.execute_next_subjob_or_teardown_slave(slave)

        slave.teardown.assert_called_with()
开发者ID:dncarley,项目名称:ClusterRunner,代码行数:15,代码来源:test_build.py


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