From: Aaron Traas Date: Sun, 16 Jul 2017 11:27:39 +0000 (-0400) Subject: YAML coverage generator minor cleanup X-Git-Tag: 1.3~78 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=818b95a85facfc793d6a652ca6467405c7d37c7c;p=open-adventure.git YAML coverage generator minor cleanup --- diff --git a/tests/coverage_dungeon.py b/tests/coverage_dungeon.py index b5afa08..d530c82 100755 --- a/tests/coverage_dungeon.py +++ b/tests/coverage_dungeon.py @@ -219,7 +219,8 @@ if __name__ == "__main__": category["percent"] = (category["covered"] / float(category["total"])) * 100 # render section header - cat_keys = list(category["messages"].items())[0][1].keys() + cat_messages = sorted(category["messages"].items()) + cat_keys = cat_messages[0][1].keys() headers_html = "" colspan = 10 - len(cat_keys) for key in cat_keys: @@ -227,7 +228,7 @@ if __name__ == "__main__": category_html = HTML_CATEGORY_HEADER.format(colspan=colspan, label=category["name"], cells=headers_html) # render message coverage row - for message_id, covered in sorted(category["messages"].items()): + for message_id, covered in cat_messages: category_html_row = "" for key, value in covered.items(): category_html_row += HTML_CATEGORY_COVERAGE_CELL.format("uncovered" if value != True else "covered")