test_bugdown: Check for unknown keys in markdown_test_cases.json.

This should help protect us from typos.
This commit is contained in:
Tim Abbott
2017-10-31 08:56:19 -07:00
parent 6f029d487e
commit 8f9463bd72

View File

@@ -228,8 +228,15 @@ class BugdownTest(ZulipTestCase):
def test_bugdown_fixtures(self):
# type: () -> None
format_tests, linkify_tests = self.load_bugdown_tests()
valid_keys = set(['name', "input", "expected_output",
"bugdown_matches_marked",
"backend_only_rendering",
"marked_expected_output", "text_content"])
for name, test in format_tests.items():
# Check that there aren't any unexpected keys as those are often typos
self.assertEqual(len(set(test.keys()) - valid_keys), 0)
converted = bugdown_convert(test['input'])
print("Running Bugdown test %s" % (name,))