+ report["turn_thresholds"]["covered"] += 1
+ report["turn_thresholds"]["html"] += HTML_CATEGORY_ROW_2_FIELDS.format(msg["threshold"], success)
+
+ report["obituaries"]["total"] = len(obituaries) * 2
+ report["obituaries"]["html"] = HTML_CATEGORY_TABLE_HEADER_3_FIELDS.format("Obituary #", "query", "yes_response")
+ for i, obit in enumerate(obituaries):
+ if obit["query"] != True:
+ query_success = "uncovered"
+ else:
+ query_success = "covered"
+ report["obituaries"]["covered"] += 1
+ if obit["yes_response"] != True:
+ obit_success = "uncovered"
+ else:
+ obit_success = "covered"
+ report["obituaries"]["covered"] += 1
+ report["obituaries"]["html"] += HTML_CATEGORY_ROW_3_FIELDS.format(i, query_success, obit_success)
+
+ actions.sort()
+ report["actions"]["total"] = len(actions)
+ report["actions"]["html"] = HTML_CATEGORY_TABLE_HEADER_2_FIELDS.format("Action ID", "covered")
+ for name, action in actions:
+ if action["message"] != True:
+ success = "uncovered"
+ else:
+ success = "covered"
+ report["actions"]["covered"] += 1
+ report["actions"]["html"] += HTML_CATEGORY_ROW_2_FIELDS.format(name, success)
+
+ report["specials"]["total"] = len(specials)
+ report["specials"]["html"] = HTML_CATEGORY_TABLE_HEADER_2_FIELDS.format("Special ID", "covered")
+ for name, special in specials:
+ if special["message"] != True:
+ success = "uncovered"
+ else:
+ success = "covered"
+ report["specials"]["covered"] += 1
+ report["specials"]["html"] += HTML_CATEGORY_ROW_2_FIELDS.format(name, success)
+
+ # calculate percentages for each catagory and HTML for category tables
+ categories_html = ""
+ summary_html = ""
+ summary_stdout = "adventure.yaml coverage rate:\n"
+ for name, category in sorted(report.items()):
+ if(category["total"] > 0):
+ report[name]["percent"] = round((category["covered"] / float(category["total"])) * 100, 1)
+ summary_stdout += STDOUT_REPORT_CATEGORY.format(**report[name])
+ categories_html += HTML_CATEGORY_TABLE.format(id=name, rows=category["html"])
+ summary_html += HTML_SUMMARY_ROW.format(**report[name])
+ else:
+ report[name]["percent"] = 100;