From 7a9d6f05dbf51db840ab010172f4ed3d6fca6257 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 12 Apr 2020 14:58:34 +0100 Subject: Read font size for runs --- tests/docx/body_xml_tests.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests') diff --git a/tests/docx/body_xml_tests.py b/tests/docx/body_xml_tests.py index 04ac944..2258330 100644 --- a/tests/docx/body_xml_tests.py +++ b/tests/docx/body_xml_tests.py @@ -325,6 +325,17 @@ class RunTests(object): run = self._read_run_with_properties([font_xml]) assert_equal("Arial", run.font) + @istest + def run_has_none_font_size_by_default(self): + run = self._read_run_with_properties([]) + assert_equal(None, run.font_size) + + @istest + def run_has_font_size_read_from_properties(self): + font_size_xml = xml_element("w:sz", {"w:val": "28"}) + run = self._read_run_with_properties([font_size_xml]) + assert_equal(14, run.font_size) + def _read_run_with_properties(self, properties, styles=None): properties_xml = xml_element("w:rPr", {}, properties) run_xml = xml_element("w:r", {}, [properties_xml]) -- cgit v1.2.3