Skip to content

Commit

Permalink
[matter_yamltests] Add constraint type 'struct' (#27039)
Browse files Browse the repository at this point in the history
  • Loading branch information
vivien-apple authored and pull[bot] committed Oct 25, 2023
1 parent bc23936 commit 1094807
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/py_matter_yamltests/matter_yamltests/constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ def check_response(self, value, value_type_name) -> bool:
success = False
if self._type == 'boolean' and type(value) is bool:
success = True
elif self._type == 'struct' and type(value) is dict:
success = True
elif self._type == 'list' and type(value) is list:
success = True
elif self._type == 'char_string' and type(value) is str:
Expand Down Expand Up @@ -367,6 +369,8 @@ def get_reason(self, value, value_type_name) -> str:

if type(value) is bool:
types.append('boolean')
elif type(value) is dict:
types.append('struct')
elif type(value) is list:
types.append('list')
elif type(value) is str:
Expand Down

0 comments on commit 1094807

Please sign in to comment.