From 02e7647bc6ae8c87012113fb69fcf18f865d075c Mon Sep 17 00:00:00 2001 From: Romulo Quidute Filho <116586593+rquidute@users.noreply.github.com> Date: Fri, 27 Oct 2023 00:27:49 -0300 Subject: [PATCH] Add logs when validation fails in YAML parser (#29890) * Add log when validation fails in YAML parser * Changes after code review --- scripts/py_matter_yamltests/matter_yamltests/parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/py_matter_yamltests/matter_yamltests/parser.py b/scripts/py_matter_yamltests/matter_yamltests/parser.py index 01898641a1591f..6e9ab2a2e7224a 100644 --- a/scripts/py_matter_yamltests/matter_yamltests/parser.py +++ b/scripts/py_matter_yamltests/matter_yamltests/parser.py @@ -922,7 +922,7 @@ def _response_values_source_validation(self, expected_response, received_respons def _response_values_validation(self, expected_response, received_response, result): check_type = PostProcessCheckType.RESPONSE_VALIDATION error_success = 'The test expectation "{name} == {value}" is true' - error_failure = 'The test expectation "{name} == {value}" is false' + error_failure = 'The test expectation "{name} ({actual}) == {value}" is false' error_name_does_not_exist = 'The test expects a value named "{name}" but it does not exists in the response."' error_value_does_not_exist = 'The test expects a value but it does not exists in the response."' @@ -953,7 +953,7 @@ def _response_values_validation(self, expected_response, received_response, resu name=expected_name, value=expected_value)) else: result.error(check_type, error_failure.format( - name=expected_name, value=expected_value)) + name=expected_name, actual=received_value, value=expected_value)) def _response_value_validation(self, expected_value, received_value): if isinstance(expected_value, list):