aboutsummaryrefslogtreecommitdiff
path: root/tests/mammoth_tests.py
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-11-19 20:02:19 +0000
committerMichael Williamson <mike@zwobble.org>2016-11-19 20:02:19 +0000
commitdbc3dac871616c8549cc3ddce01cd0e98f83c1f6 (patch)
tree471ff3ef5ad09bd9b04f24068a842c75cd278bd1 /tests/mammoth_tests.py
parent6b6163f5aebd604e76add5e383f91453f906d3f7 (diff)
Include embedded style map when explicit style map is set
Diffstat (limited to 'tests/mammoth_tests.py')
-rw-r--r--tests/mammoth_tests.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/mammoth_tests.py b/tests/mammoth_tests.py
index 4a524e8..322ebf7 100644
--- a/tests/mammoth_tests.py
+++ b/tests/mammoth_tests.py
@@ -64,6 +64,22 @@ def explicit_style_map_takes_precedence_over_embedded_style_map():
@istest
+def explicit_style_map_is_combined_with_embedded_style_map():
+ with open(test_path("embedded-style-map.docx"), "rb") as fileobj:
+ result = mammoth.convert_to_html(fileobj=fileobj, style_map="r => strong")
+ assert_equal("<h1><strong>Walking on imported air</strong></h1>", result.value)
+ assert_equal([], result.messages)
+
+
+@istest
+def embedded_style_maps_can_be_disabled():
+ with open(test_path("embedded-style-map.docx"), "rb") as fileobj:
+ result = mammoth.convert_to_html(fileobj=fileobj, include_embedded_style_map=False)
+ assert_equal("<p>Walking on imported air</p>", 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")