class demo_workflow_workflows_errors_C(object):
    """Test workflow for unit-tests."""

    workflow = [
        simple_for(0, 5, 1, "X"),
        [
            start_async_workflow("demo_workflow_workflows_errors_B"),
        ], end_for, wait_for_workflows_to_complete,
        workflows_reviews(True, False)
    ]
Пример #2
0
class demo_workflow_workflows_errors(object):

    """Test workflow for unit-tests."""

    workflow = [
        simple_for(0, 5, 1, "X"),
        [
            start_async_workflow("demo_workflow_error"),
        ],
        end_for,

        simple_for(0, 5, 1),
        [
            wait_for_a_workflow_to_complete(0.1),
        ],
        end_for,

        workflows_reviews(False, False)
    ]
class demo_workflow_workflows(object):

    """Test workflow for unit-tests."""

    workflow = [
        log_info("starting"),
        simple_for(0, 20, 1, "X"),
        [
            start_async_workflow("demo_workflow"),
        ],
        end_for,

        simple_for(0, 20, 1),
        [
            wait_for_a_workflow_to_complete(0.1),
        ],
        end_for,
        workflows_reviews(True),

        simple_for(0, 20, 1, "X"),
        [
            workflow_if(num_workflow_running_greater(3), neg=True),
            [
                start_async_workflow("demo_workflow"),
            ],
            workflow_else,
            [
                wait_for_a_workflow_to_complete(0.1),
                start_async_workflow("demo_workflow"),
            ],
            set_obj_extra_data_key("nbworkflowrunning",
                                   get_nb_workflow_running),
        ],
        end_for,
        wait_for_workflows_to_complete,
        workflows_reviews(False, False)
    ]
class demo_workflow_logic(object):
    """Test workflow for unit-tests."""

    workflow = [
        foreach([0, 1, 4, 10], "step", True),
        [
            simple_for(0, 4, 1, "Iterator"),
            [
                add_data(1),
            ],
            end_for,
            workflow_if(compare_logic(get_data, 9, "gte")),
            [set_obj_extra_data_key("test", "gte9"), interrupt_workflow],
            workflow_else,
            [set_obj_extra_data_key("test", "lt9"), interrupt_workflow],
        ],
        end_for,
    ]