Skip to content

Commit

Permalink
[MatterYamlTests] null values that are saved with saveAs are not subs…
Browse files Browse the repository at this point in the history
…tituted when the key used to saved them is used
  • Loading branch information
vivien-apple committed Sep 7, 2023
1 parent 3f7d03c commit 5736e8c
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
5 changes: 2 additions & 3 deletions scripts/py_matter_yamltests/matter_yamltests/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1080,9 +1080,8 @@ def _config_variable_substitution(self, value):
variable_info = self._runtime_config_variable_storage[token]
if type(variable_info) is dict and 'defaultValue' in variable_info:
variable_info = variable_info['defaultValue']
if variable_info is not None:
tokens[idx] = variable_info
substitution_occured = True
tokens[idx] = variable_info
substitution_occured = True

if len(tokens) == 1:
return tokens[0]
Expand Down
35 changes: 35 additions & 0 deletions src/app/tests/suites/TestSaveAs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -802,3 +802,38 @@ tests:
attribute: "octet_string"
arguments:
value: readAttributeOctetStringDefaultValue

# Tests for null values
- label: "Read attribute nullable_boolean Default Value"
command: "readAttribute"
attribute: "nullable_boolean"
response:
saveAs: readAttributeNullableBooleanDefaultValue
value: false

- label: "Write attribute nullable_boolean to null"
command: "writeAttribute"
attribute: "nullable_boolean"
arguments:
value: null

- label: "Read attribute nullable_boolean null Value"
command: "readAttribute"
attribute: "nullable_boolean"
response:
saveAs: readAttributeNullableBooleanNullValue
value: null

- label:
"Read attribute nullable_boolean null Value again and compare it to
the previously saved value"
command: "readAttribute"
attribute: "nullable_boolean"
response:
value: readAttributeNullableBooleanNullValue

- label: "Write attribute nullable_boolean Default Value"
command: "writeAttribute"
attribute: "nullable_boolean"
arguments:
value: readAttributeNullableBooleanDefaultValue

0 comments on commit 5736e8c

Please sign in to comment.