aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2017-04-03 10:21:20 +0100
committerMichael Williamson <mike@zwobble.org>2017-04-03 10:21:20 +0100
commitea7996086d5f67913f4a96ce0173593e936d03b8 (patch)
tree1bd2ce1c899022d5adb390adf38a4a938b8a8bfd /tests
parent3bb202f320d0fc548bbe569f3d6abdfc0698773e (diff)
Read explicit font 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 f10bee4..51d80e9 100644
--- a/tests/docx/body_xml_tests.py
+++ b/tests/docx/body_xml_tests.py
@@ -230,6 +230,17 @@ class RunTests(object):
def run_has_vertical_alignment_read_from_vertical_alignment_element(self):
run = self._read_run_with_properties([xml_element("w:vertAlign", {"w:val": "superscript"})])
assert_equal(documents.VerticalAlignment.superscript, run.vertical_alignment)
+
+ @istest
+ def run_has_none_font_by_default(self):
+ run = self._read_run_with_properties([])
+ assert_equal(None, run.font)
+
+ @istest
+ def run_has_font_read_from_properties(self):
+ font_xml = xml_element("w:rFonts", {"w:ascii": "Arial"})
+ run = self._read_run_with_properties([font_xml])
+ assert_equal("Arial", run.font)
def _read_run_with_properties(self, properties, styles=None):
properties_xml = xml_element("w:rPr", {}, properties)