From 71ba0de364add2c5ac0285ae1d8e69cab132baf8 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 1 Dec 2013 13:36:13 +0000 Subject: Read italic property of 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 4722a4c..f688e0d 100644 --- a/tests/docx/document_xml_tests.py +++ b/tests/docx/document_xml_tests.py @@ -91,6 +91,16 @@ class ReadXmlElementTests(object): run = self._read_run_with_properties([xml_element("w:b")]) assert_equal(True, run.is_bold) + @istest + def run_is_not_italic_if_italic_element_is_not_present(self): + run = self._read_run_with_properties([]) + assert_equal(False, run.is_italic) + + @istest + 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) + def _read_run_with_properties(self, properties): properties_xml = xml_element("w:rPr", {}, properties) run_xml = xml_element("w:r", {}, [properties_xml]) -- cgit v1.2.3