Skip to content

Commit

Permalink
[matter_yamltests] Add events supports
Browse files Browse the repository at this point in the history
  • Loading branch information
vivien-apple committed Feb 6, 2023
1 parent df4ad95 commit 4634e5e
Show file tree
Hide file tree
Showing 4 changed files with 217 additions and 78 deletions.
10 changes: 9 additions & 1 deletion scripts/py_matter_yamltests/matter_yamltests/definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,19 @@ def get_type_by_name(self, cluster_name: str, target_name: str):
if struct:
return struct

event = self.get_event_by_name(cluster_name, target_name)
if event:
return event

return None

def is_fabric_scoped(self, target) -> bool:
if hasattr(target, 'qualities'):
if isinstance(target, Event):
return target.is_fabric_sensitive

if isinstance(target, Struct) and hasattr(target, 'qualities'):
return bool(target.qualities & StructQuality.FABRIC_SCOPED)

return False

def is_nullable(self, target) -> bool:
Expand Down
4 changes: 2 additions & 2 deletions scripts/py_matter_yamltests/matter_yamltests/fixes.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ def try_update_yaml_node_id_test_runner_state(tests, config):

if test.cluster == 'CommissionerCommands' or test.cluster == 'DelayCommands':
if test.command == 'PairWithCode' or test.command == 'WaitForCommissionee':
if test.response_with_placeholders:
if test.responses_with_placeholders:
# It the test expects an error, we should not update the
# nodeId of the identity.
error = test.response_with_placeholders.get('error')
error = test.responses_with_placeholders[0].get('error')
if error:
continue

Expand Down
Loading

0 comments on commit 4634e5e

Please sign in to comment.