def embedded_style_map_is_used_if_present(): 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) assert_equal("<h1>Walking on imported air</h1>", result.value) assert_equal([], result.messages)
def embedded_style_map_can_be_retrieved(): with _copy_of_test_data("single-paragraph.docx") as fileobj: mammoth.embed_style_map(fileobj, "p => h1") assert_equal("p => h1", mammoth.read_embedded_style_map(fileobj))