From 8f9463bd72feca24498155688316a25e687b4760 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Tue, 31 Oct 2017 08:56:19 -0700 Subject: [PATCH] test_bugdown: Check for unknown keys in markdown_test_cases.json. This should help protect us from typos. --- zerver/tests/test_bugdown.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/zerver/tests/test_bugdown.py b/zerver/tests/test_bugdown.py index 839f4a7431..cce8a331a7 100644 --- a/zerver/tests/test_bugdown.py +++ b/zerver/tests/test_bugdown.py @@ -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,))