diff options
| author | Michael Williamson <mike@zwobble.org> | 2013-12-01 13:36:13 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2013-12-01 13:36:13 +0000 |
| commit | 71ba0de364add2c5ac0285ae1d8e69cab132baf8 (patch) | |
| tree | 593a4069882f9dc6913a12bb2ac356d8e4ef7f1f /tests/docx/document_xml_tests.py | |
| parent | bc62c8382815d5ca3b0812247cbc46ba8430ebab (diff) | |
Read italic property of runs
Diffstat (limited to 'tests/docx/document_xml_tests.py')
| -rw-r--r-- | tests/docx/document_xml_tests.py | 10 |
1 files changed, 10 insertions, 0 deletions
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]) |
