Skip to content

Commit cba5106

Browse files
priyadarshini-niPriyadarshini Piramanayagam
and
Priyadarshini Piramanayagam
authored
fix: Enable null value for results properties (#99)
Co-authored-by: Priyadarshini Piramanayagam <priydarshini.piramanayagam@emerson.com>
1 parent 53f1188 commit cba5106

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

nisystemlink/clients/testmonitor/models/_create_result_request.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class CreateResultRequest(JsonModel):
3535
keywords: Optional[List[str]]
3636
"""A list of keywords that categorize this result."""
3737

38-
properties: Optional[Dict[str, str]]
38+
properties: Optional[Dict[str, Optional[str]]]
3939
"""A list of custom properties for this result."""
4040

4141
operator: Optional[str]

nisystemlink/clients/testmonitor/models/_result.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Result(JsonModel):
4242
keywords: Optional[List[str]]
4343
"""A list of keywords that categorize this result."""
4444

45-
properties: Optional[Dict[str, str]]
45+
properties: Optional[Dict[str, Optional[str]]]
4646
"""A list of custom properties for this result."""
4747

4848
operator: Optional[str]

nisystemlink/clients/testmonitor/models/_update_result_request.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class UpdateResultRequest(JsonModel):
3838
keywords: Optional[List[str]]
3939
"""A list of keywords that categorize this result."""
4040

41-
properties: Optional[Dict[str, str]]
41+
properties: Optional[Dict[str, Optional[str]]]
4242
"""A list of custom properties for this result."""
4343

4444
operator: Optional[str]

tests/integration/testmonitor/test_testmonitor.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import uuid
2-
from typing import List
2+
from typing import Dict, List, Optional
33

44
import pytest
55
from nisystemlink.clients.core._http_configuration import HttpConfiguration
@@ -122,7 +122,10 @@ def test__create_single_result_and_get_results__at_least_one_result_exists(
122122
status = Status.PASSED()
123123
results = [
124124
CreateResultRequest(
125-
part_number=unique_identifier, program_name=program_name, status=status
125+
part_number=unique_identifier,
126+
program_name=program_name,
127+
status=status,
128+
properties={"test": None},
126129
)
127130
]
128131
create_results(results)
@@ -318,7 +321,7 @@ def test__update_properties_with_replace__properties_replaced(
318321
original_properties = {"originalKey": "originalValue"}
319322
program_name = "Test Program"
320323
status = Status.PASSED()
321-
new_properties = {new_key: "newValue"}
324+
new_properties: Dict[str, Optional[str]] = {new_key: "newValue"}
322325
create_response: CreateResultsPartialSuccess = create_results(
323326
[
324327
CreateResultRequest(
@@ -355,7 +358,7 @@ def test__update_properties_append__properties_appended(
355358
original_properties = {original_key: "originalValue"}
356359
program_name = "Test Program"
357360
status = Status.PASSED()
358-
new_properties = {new_key: "newValue"}
361+
new_properties: Dict[str, Optional[str]] = {new_key: "newValue"}
359362
create_response: CreateResultsPartialSuccess = create_results(
360363
[
361364
CreateResultRequest(

0 commit comments

Comments
 (0)