From 6706f33c0dec917b3ffe9cde0d5a7cc91d33a5b3 Mon Sep 17 00:00:00 2001 From: C Freeman Date: Thu, 12 Dec 2024 09:59:20 -0500 Subject: [PATCH] DESC-2.2: print error messages for root node duplicates (#36545) --- src/python_testing/TC_DeviceBasicComposition.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/python_testing/TC_DeviceBasicComposition.py b/src/python_testing/TC_DeviceBasicComposition.py index 71a8b6422ecdd0..161fa3f07c6aee 100644 --- a/src/python_testing/TC_DeviceBasicComposition.py +++ b/src/python_testing/TC_DeviceBasicComposition.py @@ -892,11 +892,14 @@ def test_TC_DESC_2_2(self): 1.2, "For device types with more than one endpoint listed, ensure each of the listed endpoints has a tag attribute and the tag attributes are not the same") problems = find_tag_list_problems(roots, device_types, self.endpoints) - for ep, problem in problems.items(): - location = AttributePathLocation(endpoint_id=ep, cluster_id=Clusters.Descriptor.id, - attribute_id=Clusters.Descriptor.Attributes.TagList.attribute_id) - msg = f'problem on ep {ep}: missing feature = {problem.missing_feature}, missing attribute = {problem.missing_attribute}, duplicates = {problem.duplicates}, same_tags = {problem.same_tag}' - self.record_error(self.get_test_name(), location=location, problem=msg, spec_location="Descriptor TagList") + def record_problems(problems): + for ep, problem in problems.items(): + location = AttributePathLocation(endpoint_id=ep, cluster_id=Clusters.Descriptor.id, + attribute_id=Clusters.Descriptor.Attributes.TagList.attribute_id) + msg = f'problem on ep {ep}: missing feature = {problem.missing_feature}, missing attribute = {problem.missing_attribute}, duplicates = {problem.duplicates}, same_tags = {problem.same_tag}' + self.record_error(self.get_test_name(), location=location, problem=msg, spec_location="Descriptor TagList") + + record_problems(problems) self.print_step(2, "Identify all the direct children of the root node endpoint") root_direct_children = get_direct_children_of_root(self.endpoints) @@ -906,6 +909,7 @@ def test_TC_DESC_2_2(self): self.print_step( 2.2, "For device types with more than one endpoint listed, ensure each of the listed endpoints has a tag attribute and the tag attributes are not the same") root_problems = find_tag_list_problems([0], {0: device_types}, self.endpoints) + record_problems(root_problems) if problems or root_problems: self.fail_current_test("Problems with tags lists")