aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-11-29 21:26:26 +0000
committerMichael Williamson <mike@zwobble.org>2016-11-29 21:33:28 +0000
commit8490b30a81597c75848f87611ca9ca011851db12 (patch)
tree46c73cbc9669a447642e734d392e3ea3529fc036 /tests
parentc8516d0a4e9467d4313af4ba63196bca184812b3 (diff)
Raise error on unrecognised document element
Diffstat (limited to 'tests')
-rw-r--r--tests/styles/parser/document_matcher_parser_tests.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/styles/parser/document_matcher_parser_tests.py b/tests/styles/parser/document_matcher_parser_tests.py
index 18109ca..3977cbb 100644
--- a/tests/styles/parser/document_matcher_parser_tests.py
+++ b/tests/styles/parser/document_matcher_parser_tests.py
@@ -2,8 +2,16 @@ from nose.tools import istest, assert_equal
from mammoth import documents, document_matchers
from mammoth.styles.parser.document_matcher_parser import parse_document_matcher
+from mammoth.styles.parser.errors import LineParseError
from mammoth.styles.parser.tokeniser import tokenise
from mammoth.styles.parser.token_iterator import TokenIterator
+from ...testing import assert_raises
+
+
+@istest
+def unrecognised_document_element_raises_error():
+ error = assert_raises(LineParseError, lambda: read_document_matcher("x"))
+ assert_equal("Unrecognised document element: x", str(error))
@istest