Skip to content

Commit 09768cf

Browse files
author
Aravindhan Palanisamy
committed
update constant
1 parent d22d4c1 commit 09768cf

File tree

3 files changed

+25
-8
lines changed

3 files changed

+25
-8
lines changed

examples/test_plan/test_plan_templates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
),
4646
],
4747
file_ids=["file1", "file2"],
48-
# workspace="33eba2fe-fe42-48a1-a47f-a6669479a8aa",
48+
workspace="33eba2fe-fe42-48a1-a47f-a6669479a8aa",
4949
properties={"env": "staging", "priority": "high"},
5050
dashboard=Dashboard(
5151
id="DashBoardId", variables={"product": "PXIe-4080", "location": "Lab1"}

examples/test_plan/test_plans.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,16 @@
2323
create_test_plans_request = [
2424
CreateTestPlanRequest(
2525
name="Python integration test plan",
26-
# template_id="Python Sample Id",
2726
state="NEW",
2827
description="Test plan for verifying integration flow",
2928
assigned_to="test.user@example.com",
30-
# work_order_id="Sample-Work-Order",
3129
estimated_duration_in_seconds=86400,
3230
properties={"env": "staging", "priority": "high"},
3331
part_number="px40482",
3432
dut_id="Sample-Dut_Id",
3533
test_program="TP-Integration-001",
3634
system_filter="os:linux AND arch:x64",
37-
# workspace="IntegrationWorkspace",
35+
workspace="33eba2fe-fe42-48a1-a47f-a6669479a8aa",
3836
file_ids_from_template=["file1", "file2"],
3937
dashboard=Dashboard(
4038
id="DashBoardId", variables={"product": "PXIe-4080", "location": "Lab1"}

tests/integration/test_plan/test_test_plan_client.py

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ def _create_test_plan_templates(
9696
@pytest.mark.enterprise
9797
class TestTestPlanClient:
9898

99+
_workspace = "33eba2fe-fe42-48a1-a47f-a6669479a8aa"
100+
99101
_dashboard = Dashboard(
100102
id="DashBoardId", variables={"product": "PXIe-4080", "location": "Lab1"}
101103
)
@@ -123,14 +125,13 @@ class TestTestPlanClient:
123125
state="NEW",
124126
description="Test plan for verifying integration flow",
125127
assigned_to="test.user@example.com",
126-
# work_order_id="Sample-Work-Order",
127128
estimated_duration_in_seconds=86400,
128129
properties={"env": "staging", "priority": "high"},
129130
part_number="px40482",
130131
dut_id="Sample-Dut_Id",
131132
test_program="TP-Integration-001",
132133
system_filter="os:linux AND arch:x64",
133-
# workspace="33eba2fe-fe42-48a1-a47f-a6669479a8aa",
134+
workspace=_workspace,
134135
file_ids_from_template=["file1", "file2"],
135136
dashboard=_dashboard,
136137
execution_actions=_execution_actions,
@@ -151,7 +152,7 @@ class TestTestPlanClient:
151152
system_filter="os:linux AND arch:x64",
152153
execution_actions=_execution_actions,
153154
file_ids=["file1", "file2"],
154-
# workspace="33eba2fe-fe42-48a1-a47f-a6669479a8aa",
155+
workspace=_workspace,
155156
properties={"env": "staging", "priority": "high"},
156157
dashboard=_dashboard,
157158
)
@@ -161,14 +162,32 @@ class TestTestPlanClient:
161162
def test__create_and_delete_test_plan__returns_created_and_deleted_test_plans(
162163
self, client: TestPlanClient, create_test_plans
163164
):
164-
create_test_plan_response = create_test_plans(self._test_plan_create)
165+
create_test_plan_template_response = client.create_test_plan_templates(
166+
test_plan_templates=self._create_test_plan_template_request
167+
)
168+
169+
template_id = (
170+
create_test_plan_template_response.created_test_plan_templates[0].id
171+
if create_test_plan_template_response.created_test_plan_templates
172+
and create_test_plan_template_response.created_test_plan_templates[0].id
173+
else None
174+
)
175+
176+
assert template_id is not None
177+
178+
test_plan_request = self._test_plan_create
179+
test_plan_request[0].template_id = template_id
180+
181+
create_test_plan_response = create_test_plans(test_plan_request)
165182

166183
assert create_test_plan_response.created_test_plans is not None
167184

168185
created_test_plan = create_test_plan_response.created_test_plans[0]
169186

170187
get_test_plan_response: TestPlan = client.get_test_plan(created_test_plan.id)
171188

189+
client.delete_test_plan_templates(ids=[template_id])
190+
172191
assert created_test_plan is not None
173192
assert created_test_plan.name == "Python integration test plan"
174193
assert created_test_plan.state == State.NEW

0 commit comments

Comments
 (0)