Skip to content

Commit 632bab2

Browse files
committed
Python spec parsing: Derived cluster grammar changed.
The grammar for how command directions are inidcated changed in the underlying files. This affected derived clusters. Test updated to use the new grammar, meta-test updated.
1 parent aae22c1 commit 632bab2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/python_testing/TestSpecParsingSupport.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def get_access_enum_from_string(access_str: str) -> Clusters.AccessControl.Enums
119119
' </attribute>'
120120
' </attributes>'
121121
' <commands>'
122-
' <command id="0x00" name="ChangeToMode" response="ChangeToModeResponse">'
122+
' <command id="0x00" name="ChangeToMode" response="ChangeToModeResponse" direction="commandToServer">'
123123
' <access invokePrivilege="operate"/>'
124124
' <mandatoryConform/>'
125125
' <field id="0" name="NewMode" type="uint8">'
@@ -164,11 +164,11 @@ def get_access_enum_from_string(access_str: str) -> Clusters.AccessControl.Enums
164164
' </attribute>'
165165
' </attributes>'
166166
' <commands>'
167-
' <command id="0x00" name="ChangeToMode" direction="commandToClient">'
167+
' <command id="0x00" name="ChangeToMode">'
168168
' <access invokePrivilege="operate"/>'
169169
' <disallowConform/>'
170170
' </command>'
171-
' <command id="0x01" name="ChangeToModeResponse" direction="commandToClient">'
171+
' <command id="0x01" name="ChangeToModeResponse">'
172172
' <access invokePrivilege="operate"/>'
173173
' <disallowConform/>'
174174
' </command>'

src/python_testing/spec_parsing_support.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ def get_command_type(self, element: ElementTree.Element) -> CommandType:
358358
return CommandType.ACCEPTED
359359
raise Exception(f"Unknown direction: {element.attrib['direction']}")
360360
except KeyError:
361-
return CommandType.ACCEPTED
361+
return CommandType.UNKNOWN
362362

363363
def parse_unknown_commands(self) -> list[XmlCommand]:
364364
commands = []

0 commit comments

Comments
 (0)