aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2020-04-12 14:58:34 +0100
committerMichael Williamson <mike@zwobble.org>2020-04-12 14:58:34 +0100
commit7a9d6f05dbf51db840ab010172f4ed3d6fca6257 (patch)
tree85560bad7fddfd99a09a47932f85f0b42241dbae /tests
parent6f7852e45a08c60bdb5961c7a43b1b5bc41d3b10 (diff)
Read font size for runs
Diffstat (limited to 'tests')
-rw-r--r--tests/docx/body_xml_tests.py11
1 files changed, 11 insertions, 0 deletions
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])