aboutsummaryrefslogtreecommitdiff
path: root/tests/docx
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2014-07-06 17:37:10 +0100
committerMichael Williamson <mike@zwobble.org>2014-07-06 17:37:10 +0100
commitf1fde50666d283ff34acf00faaa2ff194915e899 (patch)
tree83904dfbd9dc80d6ba8f51661555d231afe81f87 /tests/docx
parent4f5020499cd5212e214698e14d014c9289b7c72c (diff)
Read tables from docx files
Diffstat (limited to 'tests/docx')
-rw-r--r--tests/docx/document_xml_tests.py23
1 files changed, 22 insertions, 1 deletions
diff --git a/tests/docx/document_xml_tests.py b/tests/docx/document_xml_tests.py
index 5c73cc3..133726c 100644
--- a/tests/docx/document_xml_tests.py
+++ b/tests/docx/document_xml_tests.py
@@ -143,7 +143,28 @@ class ReadXmlElementTests(object):
element = xml_element("w:tab")
tab = _read_and_get_document_xml_element(element)
assert_equal(documents.tab(), tab)
-
+
+
+ @istest
+ def word_table_is_read_as_document_table_element(self):
+ element = xml_element("w:tbl", {}, [
+ xml_element("w:tr", {}, [
+ xml_element("w:tc", {}, [
+ xml_element("w:p", {}, [])
+ ]),
+ ]),
+ ])
+ table = _read_and_get_document_xml_element(element)
+ expected_result = documents.table([
+ documents.table_row([
+ documents.table_cell([
+ documents.paragraph([])
+ ])
+ ])
+ ])
+ assert_equal(expected_result, table)
+
+
@istest
def children_of_w_ins_are_converted_normally(self):
element = xml_element("w:p", {}, [