def create_testplan(project_id, release_testplan, build_testplan):
    """
    Creates release test plan and build test plan
    """
    from pylero.plan import Plan

    release_testplan_id = release_testplan.replace(".", "_")
    build_testplan_id = build_testplan.replace(".", "_")
    rst_res = Plan.search("id:{}".format(release_testplan_id))
    if rst_res == []:
        Plan.create(release_testplan_id, release_testplan, project_id, None,
                    "release")
    else:
        print("release test plan {} already exists".format(release_testplan))
    plan = Plan(project_id=project_id, plan_id=release_testplan_id)
    if plan.status == "open":
        plan.status = "inprogress"
        plan.update()

    btp_res = Plan.search("id:{}".format(build_testplan_id))
    if btp_res == []:
        res = Plan.create(build_testplan_id, build_testplan, project_id,
                          release_testplan_id, "iteration")
    else:
        res = True
        print("build test plan {} already exists".format(build_testplan))

    plan = Plan(project_id=project_id, plan_id=build_testplan_id)
    if plan.status == "open":
        plan.status = "inprogress"
        plan.update()

    return res
Ejemplo n.º 2
0
 def test_009_update(self):
     plan = Plan(project_id=DEFAULT_PROJ, plan_id=PLAN_ID)
     plan.color = "red"
     plan.update()
     plan.color = ""
     plan.reload()
     self.assertEquals(plan.color, "red")