Exemplo n.º 1
0
def test_project_unfinished_logic_with_loop(scene: Scene, project: UpdateableCachedProject) -> None:

    project.upsert_logic_item(LogicItem(ac1.id, ac2.id))
    project.upsert_logic_item(LogicItem(ac2.id, ac1.id))

    with pytest.raises(Arcor2Exception):
        check_for_loops(project, ac1.id)
Exemplo n.º 2
0
def test_project_wo_loop_branched_logic(scene: Scene, project: UpdateableCachedProject) -> None:

    project.upsert_logic_item(LogicItem(LogicItem.START, ac1.id))
    project.upsert_logic_item(LogicItem(ac1.id, ac2.id, ProjectLogicIf(f"{ac1.id}/default/0", json.dumps(True))))
    project.upsert_logic_item(LogicItem(ac1.id, ac3.id, ProjectLogicIf(f"{ac1.id}/default/0", json.dumps(False))))
    project.upsert_logic_item(LogicItem(ac2.id, ac4.id))
    project.upsert_logic_item(LogicItem(ac3.id, ac4.id))
    project.upsert_logic_item(LogicItem(ac4.id, LogicItem.END))

    check_for_loops(project)
Exemplo n.º 3
0
def test_project_wo_loop(scene: Scene, project: UpdateableCachedProject) -> None:

    project.upsert_logic_item(LogicItem(LogicItem.START, ac1.id))
    project.upsert_logic_item(LogicItem(ac1.id, ac2.id))
    project.upsert_logic_item(LogicItem(ac2.id, ac3.id))
    project.upsert_logic_item(LogicItem(ac3.id, ac4.id))
    project.upsert_logic_item(LogicItem(ac4.id, LogicItem.END))

    check_for_loops(project)
Exemplo n.º 4
0
def test_project_unfinished_logic_wo_loop(scene: Scene, project: UpdateableCachedProject) -> None:

    project.upsert_logic_item(LogicItem(ac1.id, ac2.id))
    check_for_loops(project, ac1.id)