diff options
| -rw-r--r-- | mammoth/styles/parser/document_matcher_parser.py | 3 | ||||
| -rw-r--r-- | tests/styles/parser/document_matcher_parser_tests.py | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/mammoth/styles/parser/document_matcher_parser.py b/mammoth/styles/parser/document_matcher_parser.py index 6d69a8f..5f85a18 100644 --- a/mammoth/styles/parser/document_matcher_parser.py +++ b/mammoth/styles/parser/document_matcher_parser.py @@ -70,5 +70,4 @@ def _parse_list_type(tokens): elif list_type == "unordered-list": return False else: - pass - # TODO: raise + raise LineParseError("Unrecognised list type: {0}".format(list_type)) diff --git a/tests/styles/parser/document_matcher_parser_tests.py b/tests/styles/parser/document_matcher_parser_tests.py index 3977cbb..e34bb79 100644 --- a/tests/styles/parser/document_matcher_parser_tests.py +++ b/tests/styles/parser/document_matcher_parser_tests.py @@ -55,6 +55,12 @@ def reads_paragraph_unordered_list(): @istest +def unrecognised_list_type_raises_error(): + error = assert_raises(LineParseError, lambda: read_document_matcher("p:blah")) + assert_equal("Unrecognised list type: blah", str(error)) + + +@istest def reads_plain_run(): assert_equal( document_matchers.run(), |
