Skip to content

Commit 15572cc

Browse files
author
Ammar Husain Mian Fazulul
committed
resolved comments
1 parent 5697644 commit 15572cc

File tree

7 files changed

+39
-35
lines changed

7 files changed

+39
-35
lines changed

examples/test_plan/test_plan_templates.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from nisystemlink.clients.core._http_configuration import HttpConfiguration
22
from nisystemlink.clients.test_plan import TestPlanClient
33
from nisystemlink.clients.test_plan.models import (
4+
CreateTestPlanTemplateRequest,
45
QueryTestPlanTemplatesRequest,
5-
TestPlanTemplateBase,
66
)
77

88

@@ -15,9 +15,9 @@
1515

1616
# Test plan template request metadata
1717
create_test_plan_template_request = [
18-
TestPlanTemplateBase(
18+
CreateTestPlanTemplateRequest(
1919
name="Python integration test plan template",
20-
templateGroup="sample template group",
20+
template_group="sample template group",
2121
workspace="33eba2fe-fe42-48a1-a47f-a6669479a8aa",
2222
)
2323
]

nisystemlink/clients/test_plan/_test_plan_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def update_test_plans(
145145

146146
@post("testplan-templates", args=[Field("testPlanTemplates")])
147147
def create_test_plan_templates(
148-
self, test_plan_templates: List[models.TestPlanTemplateBase]
148+
self, test_plan_templates: List[models.CreateTestPlanTemplateRequest]
149149
) -> models.CreateTestPlanTemplatePartialSuccessResponse:
150150
"""Creates one or more test plan template and return errors for failed creations.
151151

nisystemlink/clients/test_plan/models/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,8 @@
6060
from nisystemlink.clients.test_plan.models._paged_test_plan_templates import (
6161
PagedTestPlanTemplates,
6262
)
63+
from nisystemlink.clients.test_plan.models._create_test_plan_template_request import (
64+
CreateTestPlanTemplateRequest,
65+
)
6366

6467
# flake8: noqa
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from nisystemlink.clients.test_plan.models._test_plan_templates import (
2+
TestPlanTemplateBase,
3+
)
4+
5+
6+
class CreateTestPlanTemplateRequest(TestPlanTemplateBase):
7+
"""Contains information about a test plan template request."""
8+
9+
name: str
10+
"""Name of the test plan template."""
11+
12+
template_group: str
13+
"""The template group defined by the user."""

nisystemlink/clients/test_plan/models/_query_test_plan_templates_request.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from enum import Enum
33
from typing import List, Optional
44

5-
from nisystemlink.clients.core._uplink._json_model import JsonModel
5+
from nisystemlink.clients.core._uplink._with_paging import WithPaging
66

77

88
class TestPlanTemplateOrderBy(str, Enum):
@@ -37,7 +37,7 @@ class TestPlanTemplateField(str, Enum):
3737
UPDATED_AT = enum.auto()
3838

3939

40-
class QueryTestPlanTemplatesRequest(JsonModel):
40+
class QueryTestPlanTemplatesRequest(WithPaging):
4141
"""Request information for the query test plan templates API."""
4242

4343
filter: Optional[str] = None
@@ -91,18 +91,14 @@ class QueryTestPlanTemplatesRequest(JsonModel):
9191
"""Whether to return the test plan templates in the descending order. By default, test plan
9292
templates are sorted in the ascending order."""
9393

94-
continuation_token: Optional[str] = None
95-
"""Allows users to continue the query at the next test plan templates that matches the given
96-
criteria."""
97-
9894
projection: Optional[List[TestPlanTemplateField]] = None
9995
"""
10096
Gets or sets the projection to be used when retrieving the assets. If not specified,
10197
all properties will be returned.
10298
"""
10399

104100

105-
class _QueryTestPlanTemplatesRequest(JsonModel):
101+
class _QueryTestPlanTemplatesRequest(WithPaging):
106102
"""Request information for the query test plan templates API."""
107103

108104
filter: Optional[str] = None
@@ -158,10 +154,6 @@ class _QueryTestPlanTemplatesRequest(JsonModel):
158154
"""Whether to return the test plan templates in the descending order. By default, test plan
159155
templates are sorted in the ascending order."""
160156

161-
continuation_token: Optional[str] = None
162-
"""Allows users to continue the query at the next test plan templates that matches the given
163-
criteria."""
164-
165157
projection: Optional[List[str]] = None
166158
"""
167159
Gets or sets the projection to be used when retrieving the assets. If not specified,

nisystemlink/clients/test_plan/models/_query_test_plans_request.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import enum
22
from typing import List, Optional
33

4-
from nisystemlink.clients.core._uplink._json_model import JsonModel
4+
from nisystemlink.clients.core._uplink._with_paging import WithPaging
55

66
from ._order_by import OrderBy
77

@@ -41,7 +41,7 @@ class TestPlanField(enum.Enum):
4141
WORKFLOW = enum.auto()
4242

4343

44-
class QueryTestPlansRequest(JsonModel):
44+
class QueryTestPlansRequest(WithPaging):
4545
"""Represents the request body for querying test plans.
4646
Allows filtering, sorting, and pagination of test plan results.
4747
"""
@@ -61,17 +61,14 @@ class QueryTestPlansRequest(JsonModel):
6161
return_count: Optional[bool] = None
6262
"""Whether to include the total count of matching test plans in the response."""
6363

64-
continuation_token: Optional[str] = None
65-
"""A token to retrieve the next page of results for paginated queries."""
66-
6764
projection: Optional[List[TestPlanField]] = None
6865
"""
6966
Gets or sets the projection to be used when retrieving the assets. If not specified,
7067
all properties will be returned.
7168
"""
7269

7370

74-
class _QueryTestPlansRequest(JsonModel):
71+
class _QueryTestPlansRequest(WithPaging):
7572
"""Represents the request body for querying test plans.
7673
Allows filtering, sorting, and pagination of test plan results.
7774
"""
@@ -91,9 +88,6 @@ class _QueryTestPlansRequest(JsonModel):
9188
return_count: Optional[bool] = None
9289
"""Whether to include the total count of matching test plans in the response."""
9390

94-
continuation_token: Optional[str] = None
95-
"""A token to retrieve the next page of results for paginated queries."""
96-
9791
projection: Optional[List[str]] = None
9892
"""Gets or sets the projection to be used when retrieving the assets. If not specified,
9993
all properties will be returned.

tests/integration/test_plan/test_test_plans.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
from nisystemlink.clients.test_plan.models._create_test_plan_request import (
88
CreateTestPlanRequest,
99
)
10+
from nisystemlink.clients.test_plan.models._create_test_plan_template_request import (
11+
CreateTestPlanTemplateRequest,
12+
)
1013
from nisystemlink.clients.test_plan.models._create_test_plan_templates_partial_success_response import (
1114
CreateTestPlanTemplatePartialSuccessResponse,
1215
)
@@ -40,7 +43,6 @@
4043
from nisystemlink.clients.test_plan.models._test_plan import TestPlan
4144
from nisystemlink.clients.test_plan.models._test_plan_templates import (
4245
TestPlanTemplate,
43-
TestPlanTemplateBase,
4446
)
4547
from nisystemlink.clients.test_plan.models._update_test_plan_request import (
4648
UpdateTestPlanRequest,
@@ -62,7 +64,7 @@ def create_test_plan_templates(client: TestPlanClient):
6264
responses: List[CreateTestPlanTemplatePartialSuccessResponse] = []
6365

6466
def _create_test_plan_templates(
65-
new_test_plan_templates: List[TestPlanTemplateBase],
67+
new_test_plan_templates: List[CreateTestPlanTemplateRequest],
6668
) -> CreateTestPlanTemplatePartialSuccessResponse:
6769
response = client.create_test_plan_templates(
6870
test_plan_templates=new_test_plan_templates
@@ -286,10 +288,10 @@ def test__query_test_plans_with_projections__returns_the_test_plans_with_project
286288
def test__create_test_plan_template__returns_created_test_plan_template(
287289
self, client: TestPlanClient, create_test_plan_templates
288290
):
289-
create_test_plan_template_request: List[TestPlanTemplateBase] = [
290-
TestPlanTemplateBase(
291+
create_test_plan_template_request: List[CreateTestPlanTemplateRequest] = [
292+
CreateTestPlanTemplateRequest(
291293
name="Python integration test plan template",
292-
templateGroup="sample template group",
294+
template_group="sample template group",
293295
workspace="33eba2fe-fe42-48a1-a47f-a6669479a8aa",
294296
)
295297
]
@@ -314,10 +316,10 @@ def test__query_test_plan_template__returns_queried_test_plan_template(
314316
self, client: TestPlanClient, create_test_plan_templates
315317
):
316318

317-
create_test_plan_template_request: List[TestPlanTemplateBase] = [
318-
TestPlanTemplateBase(
319+
create_test_plan_template_request: List[CreateTestPlanTemplateRequest] = [
320+
CreateTestPlanTemplateRequest(
319321
name="Python integration test plan template",
320-
templateGroup="sample template group",
322+
template_group="sample template group",
321323
workspace="33eba2fe-fe42-48a1-a47f-a6669479a8aa",
322324
)
323325
]
@@ -348,10 +350,10 @@ def test__query_test_plan_template__returns_queried_test_plan_template(
348350

349351
def test__delete_test_plan_template(self, client: TestPlanClient):
350352

351-
create_test_plan_template_request: List[TestPlanTemplateBase] = [
352-
TestPlanTemplateBase(
353+
create_test_plan_template_request: List[CreateTestPlanTemplateRequest] = [
354+
CreateTestPlanTemplateRequest(
353355
name="Python integration test plan template",
354-
templateGroup="sample template group",
356+
template_group="sample template group",
355357
workspace="33eba2fe-fe42-48a1-a47f-a6669479a8aa",
356358
)
357359
]

0 commit comments

Comments
 (0)