Skip to content

Commit 8209beb

Browse files
author
Vishnu Govindaraj
committed
fix: clean up test methods
Signed-off-by: Vishnu Govindaraj <[email protected]>
1 parent e11375a commit 8209beb

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

examples/spec/get_and_query_specs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
created_response = client.create_specs(CreateSpecificationsRequest(specs=spec_requests))
7272

7373
# use get for first spec created
74-
if len(created_response.created_specs) > 0:
74+
if created_response.created_specs and len(created_response.created_specs) > 0:
7575
created_spec = client.get_spec(created_response.created_specs[0].id)
7676

7777
# You can query specs based on any field using DynamicLinq syntax.

nisystemlink/clients/core/_api_error_response.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ class ApiErrorResponse:
55
"""Represents an error response from the SystemLink API responses."""
66

77
error: ApiError
8-

tests/integration/spec/test_spec.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -261,17 +261,13 @@ def test__get_spec_by_id__spec_matches_expected(
261261
assert get_spec_response.id == created_spec.id
262262
assert get_spec_response.product_id == productId
263263

264-
def test__get_non_existant_spec_by_id__get_spec_fails(
265-
self, client: SpecClient
266-
):
264+
def test__get_non_existant_spec_by_id__get_spec_fails(self, client: SpecClient):
267265
non_existant_spec_id = "10"
268266
with pytest.raises(ApiException) as exception_info:
269267
client.get_spec(non_existant_spec_id)
270268
assert exception_info.value.http_status_code == 404
271269

272-
def test__get_spec_by_invalid_id__get_spec_fails(
273-
self, client: SpecClient
274-
):
270+
def test__get_spec_by_invalid_id__get_spec_fails(self, client: SpecClient):
275271
invalid_spec_id = "110ac9e841879870a0b410dabfa02a0e"
276272
with pytest.raises(ApiException) as exception_info:
277273
client.get_spec(invalid_spec_id)

0 commit comments

Comments
 (0)