def id_and_body_of_footnote_are_read():
    footnote_body = [xml_element("w:p")]
    footnotes = create_footnotes_reader(body_xml.reader())(xml_element("w:footnotes", {}, [
        xml_element("w:footnote", {"w:id": "1"}, footnote_body),
    ]))
    assert_equal(1, len(footnotes.value))
    assert isinstance(footnotes.value[0].body[0], documents.Paragraph)
    assert_equal("1", footnotes.value[0].note_id)
Esempio n. 2
0
def id_and_body_of_footnote_are_read():
    footnote_body = [xml_element("w:p")]
    footnotes = create_footnotes_reader(body_xml.reader())(xml_element(
        "w:footnotes", {}, [
            xml_element("w:footnote", {"w:id": "1"}, footnote_body),
        ]))
    assert_equal(1, len(footnotes.value))
    assert isinstance(footnotes.value[0].body[0], documents.Paragraph)
    assert_equal("1", footnotes.value[0].note_id)
Esempio n. 3
0
def _assert_footnote_type_is_ignored(footnote_type):
    footnote_body = [xml_element("w:p")]
    footnotes = create_footnotes_reader(None)(xml_element(
        "w:footnotes", {}, [
            xml_element("w:footnote", {
                "w:id": "1",
                "w:type": footnote_type
            }, footnote_body),
        ]))
    assert_equal(0, len(footnotes.value))
def _assert_footnote_type_is_ignored(footnote_type):
    footnote_body = [xml_element("w:p")]
    footnotes = create_footnotes_reader(None)(xml_element("w:footnotes", {}, [
        xml_element("w:footnote", {"w:id": "1", "w:type": footnote_type}, footnote_body),
    ]))
    assert_equal(0, len(footnotes.value))