Skip to content

Commit

Permalink
Fix issue where CI is failing because pseduo cluster does not have re…
Browse files Browse the repository at this point in the history
…sponse mapping (#24823)
  • Loading branch information
tehampson authored and pull[bot] committed Sep 13, 2023
1 parent dfbb563 commit 3072433
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions scripts/py_matter_yamltests/matter_yamltests/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,14 +690,21 @@ def _response_constraints_validation(self, response, result):
received_value = response.get('value')
if not self.is_attribute:
expected_name = value.get('name')
response_type_name = self._test.response_mapping.get(
expected_name)
if received_value is None or expected_name not in received_value:
received_value = None
else:
received_value = received_value.get(
expected_name) if received_value else None

if self._test.response_mapping:
response_type_name = self._test.response_mapping.get(
expected_name)
else:
# We don't have a mapping for this type. This happens for pseduo clusters.
# If there is a constraint check for the type it is likely an incorrect
# constraint check by the test writter.
response_type_name = None

constraints = get_constraints(value['constraints'])

if all([constraint.is_met(received_value, response_type_name) for constraint in constraints]):
Expand Down

0 comments on commit 3072433

Please sign in to comment.