Skip to content

Commit

Permalink
Add sub-list test and comment
Browse files Browse the repository at this point in the history
  • Loading branch information
cecille committed Aug 25, 2023
1 parent dacf280 commit 5cc2bfa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/python_testing/TC_DeviceBasicComposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ def find_tag_list_problems(roots: list[int], device_types: dict[int, dict[int, s
for other in endpoints:
if other == endpoint:
continue
# The OTHER endpoint is missing a tag list attribute - ignore this here, we'll catch that when we assess this endpoint as the primary
if Clusters.Descriptor.Attributes.TagList not in endpoint_dict[other][Clusters.Descriptor]:
continue

Expand Down
10 changes: 10 additions & 0 deletions src/python_testing/TestMatterTestingSupport.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,16 @@ def test_tag_list_problems(self):
problems = find_tag_list_problems(roots, device_types, simple)
asserts.assert_equal(len(problems), 0, "Unexpected problems found in list")

# One tag list is a subset of the other - this should pass
tag1 = Clusters.Descriptor.Structs.SemanticTagStruct(tag=1)
tag2 = Clusters.Descriptor.Structs.SemanticTagStruct(tag=2)
tag3 = Clusters.Descriptor.Structs.SemanticTagStruct(tag=3)

simple[2][Clusters.Descriptor][Clusters.Descriptor.Attributes.TagList] = [tag1, tag2]
simple[3][Clusters.Descriptor][Clusters.Descriptor.Attributes.TagList] = [tag1, tag2, tag3]
problems = find_tag_list_problems(roots, device_types, simple)
asserts.assert_equal(len(problems), 0, "Unexpected problems found in list")


if __name__ == "__main__":
default_matter_test_main()

0 comments on commit 5cc2bfa

Please sign in to comment.