From 500a2aca545c47b9677bd85e55b9b24dc4ec9c7c Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Fri, 21 Jul 2017 12:19:15 +0100 Subject: Add style mapping for small caps --- tests/docx/body_xml_tests.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests/docx') diff --git a/tests/docx/body_xml_tests.py b/tests/docx/body_xml_tests.py index bde96e6..c81fade 100644 --- a/tests/docx/body_xml_tests.py +++ b/tests/docx/body_xml_tests.py @@ -213,12 +213,23 @@ class RunTests(object): def run_is_struckthrough_if_strikethrough_element_is_present(self): run = self._read_run_with_properties([xml_element("w:strike")]) assert_equal(True, run.is_strikethrough) + + @istest + def run_is_not_small_caps_if_small_caps_element_is_not_present(self): + run = self._read_run_with_properties([]) + assert_equal(False, run.is_small_caps) + + @istest + def run_is_small_caps_if_small_caps_element_is_present(self): + run = self._read_run_with_properties([xml_element("w:smallCaps")]) + assert_equal(True, run.is_small_caps) run_boolean_property_test = lambda func: parameterized([ param(attr_name="is_bold", tag_name="w:b"), param(attr_name="is_underline", tag_name="w:u"), param(attr_name="is_italic", tag_name="w:i"), param(attr_name="is_strikethrough", tag_name="w:strike"), + param(attr_name="is_small_caps", tag_name="w:smallCaps"), ])(istest(func)) @run_boolean_property_test -- cgit v1.2.3