From 0b4abd3026ac77d8b7ea4f9adde759ca90abc2f6 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Fri, 18 Jul 2014 15:17:52 +0100 Subject: Read underlined runs --- tests/docx/document_xml_tests.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/docx/document_xml_tests.py') diff --git a/tests/docx/document_xml_tests.py b/tests/docx/document_xml_tests.py index 133726c..984609d 100644 --- a/tests/docx/document_xml_tests.py +++ b/tests/docx/document_xml_tests.py @@ -131,6 +131,16 @@ class ReadXmlElementTests(object): def run_is_italic_if_italic_element_is_present(self): run = self._read_run_with_properties([xml_element("w:i")]) assert_equal(True, run.is_italic) + + @istest + def run_is_not_underlined_if_underline_element_is_not_present(self): + run = self._read_run_with_properties([]) + assert_equal(False, run.is_underline) + + @istest + def run_is_underlined_if_underline_element_is_present(self): + run = self._read_run_with_properties([xml_element("w:u")]) + assert_equal(True, run.is_underline) def _read_run_with_properties(self, properties, styles=None): properties_xml = xml_element("w:rPr", {}, properties) -- cgit v1.2.3