diff --git a/scripts/py_matter_yamltests/matter_yamltests/parser.py b/scripts/py_matter_yamltests/matter_yamltests/parser.py index cb17d7a35846f8..9c5b6247380d5f 100644 --- a/scripts/py_matter_yamltests/matter_yamltests/parser.py +++ b/scripts/py_matter_yamltests/matter_yamltests/parser.py @@ -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]):