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


Python Action.fanout方法代码示例

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


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

示例1: test_remove_task

# 需要导入模块: from MilkCheck.Engine.Action import Action [as 别名]
# 或者: from MilkCheck.Engine.Action.Action import fanout [as 别名]
 def test_remove_task(self):
     """Test the behaviour of the remove_task method"""
     task_manager = action_manager_self()
     task1 = Action('start')
     task1.fanout = 260
     task2 = Action('stop')
     task2.fanout = 85
     task3 = Action('status')
     task3.fanout = 85
     task4 = Action('check')
     task4.fanout = 148
     task_manager.add_task(task1)
     task_manager.add_task(task2)
     task_manager.add_task(task3)
     task_manager.add_task(task4)
     task_manager.remove_task(task2)
     self.assertEqual(task_manager.fanout, 85)
     task_manager.remove_task(task3)
     self.assertEqual(task_manager.fanout, 148)
     task_manager.remove_task(task4)
     self.assertEqual(task_manager.fanout, 260)
     task_manager.remove_task(task1)
     self.assertFalse(task_manager.fanout)
     self.assertEqual(task_manager.tasks_count, 0)
     self.assertEqual(task_manager.tasks_done_count, 4)
开发者ID:cea-hpc,项目名称:milkcheck,代码行数:27,代码来源:ActionTest.py

示例2: test_add_task_weird_values

# 需要导入模块: from MilkCheck.Engine.Action import Action [as 别名]
# 或者: from MilkCheck.Engine.Action.Action import fanout [as 别名]
 def test_add_task_weird_values(self):
     """Test the method add task with task without fanout"""
     task_manager = action_manager_self()
     task1 = Action('start')
     task1.fanout = 60
     task2 = Action('stop')
     task3 = Action('status')
     task3.fanout = 50
     task_manager.add_task(task1)
     task_manager.add_task(task2)
     task_manager.add_task(task3)
     self.assertEqual(task_manager.fanout, 50)
     self.assertEqual(task_manager.tasks_count, 3)
开发者ID:cea-hpc,项目名称:milkcheck,代码行数:15,代码来源:ActionTest.py

示例3: test_set_of_running_task

# 需要导入模块: from MilkCheck.Engine.Action import Action [as 别名]
# 或者: from MilkCheck.Engine.Action.Action import fanout [as 别名]
 def test_set_of_running_task(self):
     """
     Test return a sets of running tasks from the property running_tasks
     """
     task_manager = action_manager_self()
     task1 = Action('start')
     task1.fanout = 260
     task2 = Action('stop')
     task2.fanout = 85
     task3 = Action('status')
     task3.fanout = 148
     task_manager.add_task(task1)
     task_manager.add_task(task2)
     task_manager.add_task(task3)
     self.assertTrue(task_manager.running_tasks)
     self.assertEqual(len(task_manager.running_tasks), 3)
开发者ID:cea-hpc,项目名称:milkcheck,代码行数:18,代码来源:ActionTest.py

示例4: test__is_running_task

# 需要导入模块: from MilkCheck.Engine.Action import Action [as 别名]
# 或者: from MilkCheck.Engine.Action.Action import fanout [as 别名]
 def test__is_running_task(self):
     """Test the behaviour of the method _is_running_task"""
     task_manager = action_manager_self()
     task1 = Action('start')
     task1.fanout = 260
     task2 = Action('stop')
     task2.fanout = 85
     task3 = Action('status')
     task3.fanout = 148
     task4 = Action('check')
     task_manager.add_task(task1)
     task_manager.add_task(task3)
     task_manager.add_task(task4)
     self.assertTrue(task_manager._is_running_task(task3))
     self.assertTrue(task_manager._is_running_task(task4))
     self.assertRaises(AssertionError, task_manager._is_running_task, None)
     self.assertFalse(task_manager._is_running_task(task2))
开发者ID:cea-hpc,项目名称:milkcheck,代码行数:19,代码来源:ActionTest.py

示例5: test_add_task

# 需要导入模块: from MilkCheck.Engine.Action import Action [as 别名]
# 或者: from MilkCheck.Engine.Action.Action import fanout [as 别名]
 def test_add_task(self):
     """Test the behaviour of the add_task method"""
     task_manager = action_manager_self()
     task1 = Action('start')
     task1.fanout = 60
     task2 = Action('stop')
     task2.fanout = 12
     task3 = Action('status')
     task3.fanout = 50
     task_manager.add_task(task1)
     task_manager.add_task(task2)
     task_manager.add_task(task3)
     task_manager.add_task(task3)
     self.assertEqual(task_manager.fanout, 12)
     task4 = Action('check')
     task4.fanout = 3
     task_manager.add_task(task4)
     self.assertEqual(task_manager.fanout, 3)
     self.assertEqual(task_manager.tasks_count, 4)
     self.assertEqual(task_manager.tasks_done_count, 4)
开发者ID:cea-hpc,项目名称:milkcheck,代码行数:22,代码来源:ActionTest.py


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