Skip to content

Commit

Permalink
DESC-2.2: print error messages for root node duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
cecille committed Nov 18, 2024
1 parent c56d0f0 commit ba9d8ac
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/python_testing/TC_DeviceBasicComposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -819,11 +819,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)
Expand All @@ -833,6 +836,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")
Expand Down

0 comments on commit ba9d8ac

Please sign in to comment.