aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-11-19 19:44:31 +0000
committerMichael Williamson <mike@zwobble.org>2016-11-19 19:44:46 +0000
commit6b6163f5aebd604e76add5e383f91453f906d3f7 (patch)
treeeee783ff66554637cc0c0c7469b70b9e3c279a73
parenta2efd2e2a4437b4e05d6842e2510d96fb144f240 (diff)
Test that explicit style map takes precendence over embedded style map
-rw-r--r--tests/mammoth_tests.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/mammoth_tests.py b/tests/mammoth_tests.py
index 1f638ec..4a524e8 100644
--- a/tests/mammoth_tests.py
+++ b/tests/mammoth_tests.py
@@ -56,6 +56,14 @@ def embedded_style_map_is_used_if_present():
@istest
+def explicit_style_map_takes_precedence_over_embedded_style_map():
+ with open(test_path("embedded-style-map.docx"), "rb") as fileobj:
+ result = mammoth.convert_to_html(fileobj=fileobj, style_map="p => p")
+ 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")