aboutsummaryrefslogtreecommitdiff
path: root/tests/docx
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2020-04-12 15:09:16 +0100
committerMichael Williamson <mike@zwobble.org>2020-04-12 15:09:16 +0100
commit51e109968beb0c4f2fc4ac8524c3bbf1b74da369 (patch)
tree9bb7a89c0b52c3cad074fabea2380a371a5fb253 /tests/docx
parenta3c287007942dbe119ebdc7111f5996e083ced7e (diff)
Only parse integer font sizes
Diffstat (limited to 'tests/docx')
-rw-r--r--tests/docx/body_xml_tests.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/docx/body_xml_tests.py b/tests/docx/body_xml_tests.py
index 2258330..17d631d 100644
--- a/tests/docx/body_xml_tests.py
+++ b/tests/docx/body_xml_tests.py
@@ -336,6 +336,12 @@ class RunTests(object):
run = self._read_run_with_properties([font_size_xml])
assert_equal(14, run.font_size)
+ @istest
+ def run_with_invalid_w_sz_has_none_font_size(self):
+ font_size_xml = xml_element("w:sz", {"w:val": "28a"})
+ run = self._read_run_with_properties([font_size_xml])
+ assert_equal(None, 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])