The problematic code that causes "TypeError: string indices must be integers":
-> self.assertEqual(
expected,
sorted(hook_results,
key=lambda i: list(
i["config"]["trigger"].values())[0]["unit"]))
(Pdb) hook_results[0]["config"]["trigger"]
{'name': 'event', 'args': {'unit': 'iteration', 'at': [5]}}
values[0] is not always a dict with a unit element:
(Pdb) hook_results[0]["config"]["trigger"].values()
dict_values(['event', {'unit': 'iteration', 'at': [5]}])
We should use args['args']['unit'] instead.
Change-Id: I42db6045ae88c34d3576beb737bb7e955c5f2132
Needed-By: I4991acccefd4754e209feafd5e24d03c76c283f8