本文整理汇总了Python中app.master.build.Build._unstarted_subjobs方法的典型用法代码示例。如果您正苦于以下问题:Python Build._unstarted_subjobs方法的具体用法?Python Build._unstarted_subjobs怎么用?Python Build._unstarted_subjobs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app.master.build.Build
的用法示例。
在下文中一共展示了Build._unstarted_subjobs方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_teardown_called_on_slave_when_no_subjobs_remain
# 需要导入模块: from app.master.build import Build [as 别名]
# 或者: from app.master.build.Build import _unstarted_subjobs [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.execute_next_subjob_on_slave(slave)
slave.teardown.assert_called_with()
示例2: test_update_state_to_canceled_sets_state_correctly
# 需要导入模块: from app.master.build import Build [as 别名]
# 或者: from app.master.build.Build import _unstarted_subjobs [as 别名]
def test_update_state_to_canceled_sets_state_correctly(self):
build = Build(BuildRequest({}))
build._unstarted_subjobs = Queue()
success = build.update_state({'status': 'canceled'})
self.assertEqual(build._status(), BuildStatus.CANCELED, "Status not set to canceled")
self.assertTrue(success, "Update did not report success")
示例3: test_execute_next_subjob_with_empty_queue_cant_teardown_same_slave_twice
# 需要导入模块: from app.master.build import Build [as 别名]
# 或者: from app.master.build.Build import _unstarted_subjobs [as 别名]
def test_execute_next_subjob_with_empty_queue_cant_teardown_same_slave_twice(self):
build = Build(BuildRequest({}))
build._unstarted_subjobs = Queue()
slave = Mock()
slave.free_executor = Mock(return_value=0)
build._slaves_allocated.append(slave)
build.execute_next_subjob_or_teardown_slave(slave)
build.execute_next_subjob_or_teardown_slave(slave)
self.assertEqual(slave.teardown.call_count, 1, "Teardown should only be called once")
示例4: test_cancel_exits_early_if_build_not_running
# 需要导入模块: from app.master.build import Build [as 别名]
# 或者: from app.master.build.Build import _unstarted_subjobs [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")
示例5: test_cancel_depletes_queue_and_sets_canceled
# 需要导入模块: from app.master.build import Build [as 别名]
# 或者: from app.master.build.Build import _unstarted_subjobs [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")
示例6: test_teardown_called_on_slave_when_slave_in_shutdown_mode
# 需要导入模块: from app.master.build import Build [as 别名]
# 或者: from app.master.build.Build import _unstarted_subjobs [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()