diff options
| author | Michael Williamson <mike@zwobble.org> | 2013-12-14 16:36:27 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2013-12-14 16:36:27 +0000 |
| commit | 996491337023abe6033c3caf76dfa4501bd27ce3 (patch) | |
| tree | 5d3c4bac5e7e47451e5aef0ac4d8a53b9927522b /tests | |
| parent | f1791fd544d01c118951fdca96b63a151d808941 (diff) | |
Generate styles for runs
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/conversion_tests.py | 27 |
1 files changed, 27 insertions, 0 deletions
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("<strong>Hello</strong>", 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("<em>Hello</em>", 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('<span class="tip">Tip</span>', result.value) def _run_with_text(text): |
