print(f'| {colorize_result(self.result)}', end='')
def json_dump(self, with_results):
- dump = [self.name, self.type, self.expected, self.decision, self.reason]
+ dump = {
+ "option_name": self.name,
+ "type": self.type,
+ "desired_val": self.expected,
+ "decision": self.decision,
+ "reason": self.reason,
+ }
if with_results:
- dump.append(self.result)
+ dump["check_result_text"] = self.result
+ dump["check_result"] = "FAIL" not in self.result
return dump
def json_dump(self, with_results):
dump = self.opts[0].json_dump(False)
if with_results:
- dump.append(self.result)
+ # Add 'result_text' and 'result' keys to the dictionary
+ dump["check_result_text"] = self.result
+ dump["check_result"] = "FAIL" not in self.result
return dump