From 1677341ab9a113c286cdf80a106553069b2a16a4 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Mon, 5 Jun 2023 12:19:22 +0200 Subject: [PATCH] [matter_yamltests] Add constraint type 'struct' (#27039) --- scripts/py_matter_yamltests/matter_yamltests/constraints.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/py_matter_yamltests/matter_yamltests/constraints.py b/scripts/py_matter_yamltests/matter_yamltests/constraints.py index 572da6362aa266..7c3e2f99cc5dfd 100644 --- a/scripts/py_matter_yamltests/matter_yamltests/constraints.py +++ b/scripts/py_matter_yamltests/matter_yamltests/constraints.py @@ -232,6 +232,8 @@ def check_response(self, value, value_type_name) -> bool: success = False if self._type == 'boolean' and type(value) is bool: success = True + elif self._type == 'struct' and type(value) is dict: + success = True elif self._type == 'list' and type(value) is list: success = True elif self._type == 'char_string' and type(value) is str: @@ -367,6 +369,8 @@ def get_reason(self, value, value_type_name) -> str: if type(value) is bool: types.append('boolean') + elif type(value) is dict: + types.append('struct') elif type(value) is list: types.append('list') elif type(value) is str: