def setup(self): self.workbench = Workbench() self.workbench.register(CoreManifest()) self.workbench.register(StateManifest()) self.workbench.register(PreferencesManifest()) self.workbench.register(TaskManagerManifest()) self.root = RootTask(should_stop=Event(), should_pause=Event()) self.task = LoopTask(task_name='Test') self.root.children_task.append(self.task)
def test_check3(self): # Test handling a wrong condition. loop = LoopTask(task_name='Parent', children_task=[self.task]) self.root.children_task.append(loop) self.task.condition = '*True' test, traceback = self.task.check() assert_false(test) assert_equal(len(traceback), 1) assert_in('root/Parent/Test-cond', traceback)
def test_check1(self): # Simply test that everything is ok condition is evaluable and parent # is a Loop. loop = LoopTask(children_task=[self.task]) self.root.children_task.append(loop) self.task.condition = 'True' test, traceback = self.task.check() assert_true(test) assert_false(traceback)
def test_check_execution_order(self): # Test that the interface checks are run before the children checks. interface = IterableLoopInterface() interface.iterable = '[(1, 0)]' self.task.interface = interface subiter = IterableLoopInterface(iterable='{Test_value}') self.task.children_task = [LoopTask(interface=subiter)] test, traceback = self.task.check() assert_true(test)
def setup(self): self.root = RootTask(should_stop=Event(), should_pause=Event()) self.task = LoopTask(task_name='Test') self.root.children_task.append(self.task)