aboutsummaryrefslogtreecommitdiff
path: root/tests/docx
diff options
context:
space:
mode:
Diffstat (limited to 'tests/docx')
-rw-r--r--tests/docx/body_xml_tests.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/docx/body_xml_tests.py b/tests/docx/body_xml_tests.py
index 0f47ca2..94061fd 100644
--- a/tests/docx/body_xml_tests.py
+++ b/tests/docx/body_xml_tests.py
@@ -1,3 +1,5 @@
+# encoding=utf-8
+
import io
import sys
@@ -588,6 +590,31 @@ def soft_hyphen_element_is_read_as_soft_hyphen_character():
@istest
+def w_sym_with_supported_font_and_supported_code_point_in_ascii_range_is_converted_to_text():
+ element = xml_element("w:sym", {"w:font": "Wingdings", "w:char": "28"})
+ text = _read_and_get_document_xml_element(element)
+ assert_equal(documents.text(u"🕿"), text)
+
+
+@istest
+def w_sym_with_supported_font_and_supported_code_point_in_private_use_area_is_converted_to_text():
+ element = xml_element("w:sym", {"w:font": "Wingdings", "w:char": "F028"})
+ text = _read_and_get_document_xml_element(element)
+ assert_equal(documents.text(u"🕿"), text)
+
+
+@istest
+def w_sym_with_unsupported_font_and_code_point_produces_empty_result_with_warning():
+ element = xml_element("w:sym", {"w:font": "Dingwings", "w:char": "28"})
+
+ result = _read_document_xml_element(element)
+
+ expected_warning = results.warning("A w:sym element with an unsupported character was ignored: char 28 in font Dingwings")
+ assert_equal([expected_warning], result.messages)
+ assert_equal(None, result.value)
+
+
+@istest
class TableTests(object):
@istest
def word_table_is_read_as_document_table_element(self):