From 07480fc677e51edc2af85a5c6ed9fd9449a7dac6 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 14 Dec 2013 16:19:06 +0000 Subject: Support matching of paragraph matcher with no style --- tests/conversion_tests.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'tests/conversion_tests.py') diff --git a/tests/conversion_tests.py b/tests/conversion_tests.py index ab90eb0..d05a103 100644 --- a/tests/conversion_tests.py +++ b/tests/conversion_tests.py @@ -33,5 +33,28 @@ def paragraphs_are_converted_by_satisfying_matching_paths(): assert_equal('

Tip

', result.value) +@istest +def default_paragraph_style_is_used_if_no_matching_style_is_found(): + result = convert_document_element_to_html( + documents.paragraph(style_name="TipsParagraph", children=[ + _run_with_text("Tip") + ]), + ) + assert_equal('

Tip

', result.value) + + +@istest +def default_paragraph_style_is_specified_by_mapping_plain_paragraphs(): + result = convert_document_element_to_html( + documents.paragraph(style_name="TipsParagraph", children=[ + _run_with_text("Tip") + ]), + styles=[ + style_reader.read_style("p => p.tip") + ] + ) + assert_equal('

Tip

', result.value) + + def _run_with_text(text): return documents.run(children=[documents.text(text)]) -- cgit v1.2.3