diff options
| author | Michael Williamson <mike@zwobble.org> | 2015-08-15 18:11:46 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2015-08-15 18:11:46 +0100 |
| commit | 2c9955f0590d93968b4959e3622d01610e398700 (patch) | |
| tree | 886f42a3c647d8f0716a871685e925b95bd2bc6f /tests/mammoth_tests.py | |
| parent | 724f9f01d83865ae586e7a8f65545e1a11d2cdae (diff) | |
Continue with warning style mapping cannot be parsed
Diffstat (limited to 'tests/mammoth_tests.py')
| -rw-r--r-- | tests/mammoth_tests.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/mammoth_tests.py b/tests/mammoth_tests.py index 88aa445..ddcb9a6 100644 --- a/tests/mammoth_tests.py +++ b/tests/mammoth_tests.py @@ -7,6 +7,7 @@ from nose.tools import istest, assert_equal from .testing import test_path import mammoth +from mammoth import results @istest @@ -40,6 +41,17 @@ def empty_paragraphs_are_preserved_if_ignore_empty_paragraphs_is_false(): assert_equal("<p></p>", result.value) assert_equal([], result.messages) +@istest +def warning_if_style_mapping_is_not_understood(): + style_map = """ +!!!! +p => h1""" + with open(test_path("single-paragraph.docx"), "rb") as fileobj: + result = mammoth.convert_to_html(fileobj=fileobj, style_map=style_map) + assert_equal("<h1>Walking on imported air</h1>", result.value) + warning = "Did not understand this style mapping, so ignored it: !!!!" + assert_equal([results.warning(warning)], result.messages) + @istest def inline_images_are_included_in_output(): |
