Exemple #1
0
    def test_skip_exclusive_gateway__fail_with_invalid_node_type(self):
        top_pipeline = PipelineObject(nodes={self.node_id: ServiceActObject()})
        process = MockPipelineProcess(top_pipeline=top_pipeline)

        with patch(PIPELINE_PROCESS_GET, MagicMock(return_value=process)):
            act_result = api.skip_exclusive_gateway(self.node_id, uniqid())

            self.assertFalse(act_result.result)
Exemple #2
0
    def test_skip_exclusive_gateway__fail_with_can_not_get_process(self):
        act_result = api.skip_exclusive_gateway(self.node_id, uniqid())

        self.assertFalse(act_result.result)
        self.assertEqual(
            act_result.message,
            'invalid operation, this gateway is finished or pipeline have been revoked'
        )
Exemple #3
0
    def test_skip_exclusive_gateway__fail_with_skip_fail(self):
        eg = ExclusiveGateway(id=uniqid())
        next_node = IdentifyObject()
        setattr(eg, 'target_for_sequence_flow',
                MagicMock(return_value=next_node))
        top_pipeline = PipelineObject(nodes={self.node_id: eg})
        process = MockPipelineProcess(top_pipeline=top_pipeline)

        with patch(PIPELINE_PROCESS_GET, MagicMock(return_value=process)):
            act_result = api.skip_exclusive_gateway(self.node_id, uniqid())

            Status.objects.skip.assert_called_once_with(process, eg)

            self.assertFalse(act_result.result)
Exemple #4
0
def skip_exclusive_gateway(gateway_id, flow_id):
    return api.skip_exclusive_gateway(gateway_id, flow_id)
Exemple #5
0
    def test_skip_exclusive_gateway__fail_with_can_not_get_process(self):
        act_result = api.skip_exclusive_gateway(self.node_id, uniqid())

        self.assertFalse(act_result.result)