Skip to content

Commit

Permalink
Python spec parsing: Derived cluster grammar changed.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cecille committed Mar 6, 2024
1 parent aae22c1 commit 632bab2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/python_testing/TestSpecParsingSupport.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def get_access_enum_from_string(access_str: str) -> Clusters.AccessControl.Enums
' </attribute>'
' </attributes>'
' <commands>'
' <command id="0x00" name="ChangeToMode" response="ChangeToModeResponse">'
' <command id="0x00" name="ChangeToMode" response="ChangeToModeResponse" direction="commandToServer">'
' <access invokePrivilege="operate"/>'
' <mandatoryConform/>'
' <field id="0" name="NewMode" type="uint8">'
Expand Down Expand Up @@ -164,11 +164,11 @@ def get_access_enum_from_string(access_str: str) -> Clusters.AccessControl.Enums
' </attribute>'
' </attributes>'
' <commands>'
' <command id="0x00" name="ChangeToMode" direction="commandToClient">'
' <command id="0x00" name="ChangeToMode">'
' <access invokePrivilege="operate"/>'
' <disallowConform/>'
' </command>'
' <command id="0x01" name="ChangeToModeResponse" direction="commandToClient">'
' <command id="0x01" name="ChangeToModeResponse">'
' <access invokePrivilege="operate"/>'
' <disallowConform/>'
' </command>'
Expand Down
2 changes: 1 addition & 1 deletion src/python_testing/spec_parsing_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def get_command_type(self, element: ElementTree.Element) -> CommandType:
return CommandType.ACCEPTED
raise Exception(f"Unknown direction: {element.attrib['direction']}")
except KeyError:
return CommandType.ACCEPTED
return CommandType.UNKNOWN

def parse_unknown_commands(self) -> list[XmlCommand]:
commands = []
Expand Down

0 comments on commit 632bab2

Please sign in to comment.