aboutsummaryrefslogtreecommitdiff
path: root/tests/docx/document_xml_tests.py
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2013-12-01 13:30:53 +0000
committerMichael Williamson <mike@zwobble.org>2013-12-01 13:30:53 +0000
commitff8b54b819c08e97cc35dc123fdb4b64969d4ef6 (patch)
treed33f947d16c55d3cadad99342c76bfdfd905cd77 /tests/docx/document_xml_tests.py
parent4a35a848117c4fe646d36419096d099030878469 (diff)
Read run style from run properties
Diffstat (limited to 'tests/docx/document_xml_tests.py')
-rw-r--r--tests/docx/document_xml_tests.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/docx/document_xml_tests.py b/tests/docx/document_xml_tests.py
index 6539c54..d2ec1ee 100644
--- a/tests/docx/document_xml_tests.py
+++ b/tests/docx/document_xml_tests.py
@@ -75,6 +75,14 @@ class ReadXmlElementTests(object):
element = xml_element("w:r")
assert_equal(None, read_document_xml_element(element).style_name)
+ @istest
+ def run_has_style_name_read_from_run_properties_if_present(self):
+ style_xml = xml_element("w:rStyle", {"w:val": "Emphasis"})
+ properties_xml = xml_element("w:rPr", {}, [style_xml])
+ run_xml = xml_element("w:r", {}, [properties_xml])
+ run = read_document_xml_element(run_xml)
+ assert_equal("Emphasis", run.style_name)
+
@istest
def unrecognised_elements_are_ignored(self):