Skip to content

Commit

Permalink
[matter_yamltests] Remove support for generic success/error messages (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
vivien-apple authored and pull[bot] committed Nov 3, 2023
1 parent 4ef0470 commit 6016322
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
8 changes: 1 addition & 7 deletions scripts/py_matter_yamltests/matter_yamltests/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,13 +580,7 @@ def _response_error_validation(self, response, result):

expected_error = self.response.get('error') if self.response else None

# Handle generic success/error
if type(response) is str and response == 'failure':
received_error = response
elif type(response) is str and response == 'success':
received_error = None
else:
received_error = response.get('error')
received_error = response.get('error')

if expected_error and received_error and expected_error == received_error:
result.success(check_type, error_success.format(
Expand Down
4 changes: 2 additions & 2 deletions src/controller/python/chip/yaml/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,8 +654,8 @@ def decode(self, result: _ActionResult):
if result.response is None:
# TODO Once yamltest and idl python packages are properly packaged as a single module
# the type we are returning will be formalized. For now TestStep.post_process_response
# expects this particular case to be sent as a string.
return 'success' if result.status == _ActionStatus.SUCCESS else 'failure'
# expects this particular case to be sent an empty dict or a dict with an error.
return {} if result.status == _ActionStatus.SUCCESS else {'error': 'FAILURE'}

response = result.response

Expand Down

0 comments on commit 6016322

Please sign in to comment.