From dbc3dac871616c8549cc3ddce01cd0e98f83c1f6 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 19 Nov 2016 20:02:19 +0000 Subject: Include embedded style map when explicit style map is set --- tests/mammoth_tests.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests') 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 @@ -63,6 +63,22 @@ def explicit_style_map_takes_precedence_over_embedded_style_map(): assert_equal([], result.messages) +@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("

Walking on imported air

", 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("

Walking on imported air

", 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: -- cgit v1.2.3