Ejemplo n.º 1
0
    def test_if_activation_activate_false(self):
        next_task = FlowTaskStub()
        flow_task = self.init_node(If(lambda process: False).OnFalse(next_task))

        act = IfActivation()
        act.initialize(flow_task, TaskStub())
        act.perform()

        self.assertTrue(FlowTaskStub.activated)
Ejemplo n.º 2
0
    def test_if_activation_activate_false(self):
        next_task = FlowTaskStub()
        flow_task = self.init_node(If(lambda process: False).Else(next_task))

        act = IfActivation()
        act.initialize(flow_task, TaskStub())
        act.perform()

        self.assertTrue(FlowTaskStub.activated)
Ejemplo n.º 3
0
    def test_if_activation_with_handler_true(self):
        def handler(activation):
            return True

        next_task = FlowTaskStub()
        flow_task = self.init_node(If(handler).Then(next_task))

        act = IfActivation()
        act.initialize(flow_task, TaskStub())
        act.perform()
        self.assertTrue(FlowTaskStub.activated)
        # get correct condition
        self.assertTrue(flow_task.condition(self))