Example #1
0
def test_status_preserved_on_update(simple):
    new = deepcopy(simple)
    task_under_test = 'echo_stuff'

    assert new.node[task_under_test]['status'] == states.PENDING.name

    simple.node[task_under_test]['status'] = states.SUCCESS.name
    graph.update_plan_from_graph(new, simple)

    updated = graph.get_plan(new.graph['uid'])
    assert new.node[task_under_test]['status'] == states.SUCCESS.name
Example #2
0
def test_simple_plan_plan_created_and_loaded(simple_plan):
    plan = graph.get_plan(simple_plan.graph['uid'])
    assert set(plan.nodes()) == {'just_fail', 'echo_stuff'}
Example #3
0
def test_simple_plan_plan_created_and_loaded(simple_plan):
    plan = graph.get_plan(simple_plan.graph['uid'])
    expected_names = {n.name for n in plan.nodes()}
    assert expected_names == {'just_fail', 'echo_stuff'}
Example #4
0
def test_update_plan_with_new_node(simple):
    new = deepcopy(simple)
    new.add_node('one_more', {})
    graph.update_plan_from_graph(new, simple)
    updated = graph.get_plan(new.graph['uid'])
    assert set(updated.nodes()) == {'one_more', 'just_fail', 'echo_stuff'}
Example #5
0
def test_simple_plan_created_and_loaded(simple):
    plan = graph.get_plan(simple.graph["uid"])
    assert set(plan.nodes()) == {"just_fail", "echo_stuff"}