From 996491337023abe6033c3caf76dfa4501bd27ce3 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 14 Dec 2013 16:36:27 +0000 Subject: Generate styles for runs --- tests/conversion_tests.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'tests') diff --git a/tests/conversion_tests.py b/tests/conversion_tests.py index 647f58c..174e5b5 100644 --- a/tests/conversion_tests.py +++ b/tests/conversion_tests.py @@ -72,6 +72,33 @@ def no_warning_if_there_is_no_style_for_plain_paragraphs(): documents.paragraph(children=[_run_with_text("Tip")]), ) assert_equal([], result.messages) + + +@istest +def bold_runs_are_wrapped_in_strong_tags(): + result = convert_document_element_to_html( + documents.run(children=[documents.text("Hello")], is_bold=True), + ) + assert_equal("Hello", result.value) + + +@istest +def italic_runs_are_wrapped_in_emphasis_tags(): + result = convert_document_element_to_html( + documents.run(children=[documents.text("Hello")], is_italic=True), + ) + assert_equal("Hello", result.value) + + +@istest +def runs_are_converted_by_satisfying_matching_paths(): + result = convert_document_element_to_html( + documents.run(style_name="TipsRun", children=[documents.Text("Tip")]), + styles=[ + style_reader.read_style("r.TipsRun => span.tip") + ] + ) + assert_equal('Tip', result.value) def _run_with_text(text): -- cgit v1.2.3