summaryrefslogtreecommitdiff
path: root/tests/conversion_tests.py
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2014-06-08 22:10:01 +0100
committerMichael Williamson <mike@zwobble.org>2014-06-08 22:10:01 +0100
commit2c66c1e16ef035017d68b0023d02a1507a2c43cd (patch)
tree9a25c8cda1a1ad07d2f47d7a7e46ea2b005c5555 /tests/conversion_tests.py
parenta7631d5d73d563967afcc529b35bf10f87d29035 (diff)
Use style_name when converting paragraphs
Diffstat (limited to 'tests/conversion_tests.py')
-rw-r--r--tests/conversion_tests.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/conversion_tests.py b/tests/conversion_tests.py
index edc8bb6..527ec2e 100644
--- a/tests/conversion_tests.py
+++ b/tests/conversion_tests.py
@@ -35,7 +35,7 @@ def empty_paragraphs_are_ignored():
@istest
-def paragraphs_are_converted_by_satisfying_matching_paths():
+def style_mappings_using_style_ids_can_be_used_to_map_paragraphs():
result = convert_document_element_to_html(
documents.paragraph(style_id="TipsParagraph", children=[
_run_with_text("Tip")
@@ -48,6 +48,19 @@ def paragraphs_are_converted_by_satisfying_matching_paths():
@istest
+def style_mappings_using_style_names_can_be_used_to_map_paragraphs():
+ result = convert_document_element_to_html(
+ documents.paragraph(style_id="TipsParagraph", style_name="Tips Paragraph", children=[
+ _run_with_text("Tip")
+ ]),
+ style_map=[
+ style_reader.read_style("p[style-name='Tips Paragraph'] => p.tip")
+ ]
+ )
+ assert_equal('<p class="tip">Tip</p>', result.value)
+
+
+@istest
def default_paragraph_style_is_used_if_no_matching_style_is_found():
result = convert_document_element_to_html(
documents.paragraph(style_id="TipsParagraph", children=[