diff options
| author | Michael Williamson <mike@zwobble.org> | 2016-11-13 12:16:10 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-11-13 12:16:10 +0000 |
| commit | a2efd2e2a4437b4e05d6842e2510d96fb144f240 (patch) | |
| tree | 2c41b8288a5f717dfa59aece8484f03c0e3be292 /tests/mammoth_tests.py | |
| parent | 5f623a9554aa1b8204d5d9db62dec73e38ad084e (diff) | |
Add test for pre-created style map
Diffstat (limited to 'tests/mammoth_tests.py')
| -rw-r--r-- | tests/mammoth_tests.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/mammoth_tests.py b/tests/mammoth_tests.py index 4390544..1f638ec 100644 --- a/tests/mammoth_tests.py +++ b/tests/mammoth_tests.py @@ -49,6 +49,14 @@ def empty_paragraphs_are_preserved_if_ignore_empty_paragraphs_is_false(): @istest def embedded_style_map_is_used_if_present(): + with open(test_path("embedded-style-map.docx"), "rb") as fileobj: + result = mammoth.convert_to_html(fileobj=fileobj) + assert_equal("<h1>Walking on imported air</h1>", result.value) + assert_equal([], result.messages) + + +@istest +def embedded_style_map_can_be_written_and_then_read(): with _copy_of_test_data("single-paragraph.docx") as fileobj: mammoth.embed_style_map(fileobj, "p => h1") result = mammoth.convert_to_html(fileobj=fileobj, ignore_empty_paragraphs=False) |
