aboutsummaryrefslogtreecommitdiff
path: root/tests/docx/body_xml_tests.py
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2024-06-13 11:13:28 +0100
committerMichael Williamson <mike@zwobble.org>2024-06-13 11:13:28 +0100
commit0d5b27652c119dfaf99fae5f4e624c9efec408b5 (patch)
treea03da709ca9fc09ff0b333db4cb1b7837d0b3d93 /tests/docx/body_xml_tests.py
parentb5e5ea1cfb4d36ad4474ecb32da69623a07e06f5 (diff)
Parse run highlights
Diffstat (limited to 'tests/docx/body_xml_tests.py')
-rw-r--r--tests/docx/body_xml_tests.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/docx/body_xml_tests.py b/tests/docx/body_xml_tests.py
index 44a3e34..18cba72 100644
--- a/tests/docx/body_xml_tests.py
+++ b/tests/docx/body_xml_tests.py
@@ -405,6 +405,15 @@ class RunTests(object):
run = self._read_run_with_properties([font_size_xml])
assert_equal(None, run.font_size)
+ def test_run_has_no_highlight_by_default(self):
+ run = self._read_run_with_properties([])
+ assert_equal(None, run.highlight)
+
+ def test_run_has_highlight_read_from_properties(self):
+ highlight_xml = xml_element("w:highlight", {"w:val": "yellow"})
+ run = self._read_run_with_properties([highlight_xml])
+ assert_equal("yellow", run.highlight)
+
def _read_run_with_properties(self, properties, styles=None):
properties_xml = xml_element("w:rPr", {}, properties)
run_xml = xml_element("w:r", {}, [properties_xml])