Debug Python classes and objects to identify why tests failed, fix an existing function, and write a new function to make tests pass.
Asked in the Karat stage. Practical debugging session based on test failure signals.
Implement failure_summary(cases). cases is a list of JSON objects with name, status, and message keys. Each status is passed, failed, or skipped. Return a dictionary containing failed test names and counts for all three statuses. The input must remain plain dictionaries, while the implementation should model each case as a Python object.
cases contains zero or more dictionaries.name and status; message may be empty.name and message are strings.status is one of passed, failed, or skipped.def failure_summary(cases):