aboutsummaryrefslogtreecommitdiff
path: root/tests/docx
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2017-07-21 12:19:15 +0100
committerMichael Williamson <mike@zwobble.org>2017-07-21 12:19:15 +0100
commit500a2aca545c47b9677bd85e55b9b24dc4ec9c7c (patch)
tree61a7bb91ae91ffd498b5ad1c2e5aac4178f72bb3 /tests/docx
parent6f7fbaa001eda6aca41f9a4f54f526ef7b87b738 (diff)
Add style mapping for small caps
Diffstat (limited to 'tests/docx')
-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 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