From 7d5045309a7100dfd2404f0bcdf73d27f4883ab1 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 30 Aug 2014 10:48:30 +0100 Subject: Add parsing of footnotes XML --- tests/docx/footnotes_xml_tests.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/docx/footnotes_xml_tests.py (limited to 'tests') diff --git a/tests/docx/footnotes_xml_tests.py b/tests/docx/footnotes_xml_tests.py new file mode 100644 index 0000000..56caff0 --- /dev/null +++ b/tests/docx/footnotes_xml_tests.py @@ -0,0 +1,16 @@ +from nose.tools import istest, assert_equal, assert_is + +from mammoth.docx.xmlparser import element as xml_element +from mammoth.docx.footnotes_xml import read_footnotes_xml_element + + +@istest +def id_and_body_of_footnote_are_read(): + footnote_body = [xml_element("w:p")] + footnotes = read_footnotes_xml_element(xml_element("w:footnotes", {}, [ + xml_element("w:footnote", {"w:id": "1"}, footnote_body), + ])) + assert_equal(1, len(footnotes)) + assert_is(footnote_body, footnotes[0].body) + assert_equal("1", footnotes[0].id) + -- cgit v1.2.3