示例#1
0
    def it_loads_default_footer_XML_from_a_template_to_help(self):
        # ---tests integration with OS---
        xml_bytes = FooterPart._default_footer_xml()

        assert xml_bytes.startswith(
            b"<?xml version='1.0' encoding='UTF-8' standalone='yes'?>\n<w:ftr\n"
        )
        assert len(xml_bytes) == 1395
    def it_loads_default_footer_XML_from_a_template_to_help(self):
        # ---tests integration with OS---
        xml_bytes = FooterPart._default_footer_xml()

        assert xml_bytes.startswith(
            b"<?xml version='1.0' encoding='UTF-8' standalone='yes'?>\n<w:ftr\n"
        )
        assert len(xml_bytes) == 1395
    def it_can_create_a_new_footer_part(self, package_, _default_footer_xml_,
                                        parse_xml_, _init_):
        ftr = element("w:ftr")
        package_.next_partname.return_value = "/word/footer24.xml"
        _default_footer_xml_.return_value = "<w:ftr>"
        parse_xml_.return_value = ftr

        footer_part = FooterPart.new(package_)

        package_.next_partname.assert_called_once_with("/word/footer%d.xml")
        _default_footer_xml_.assert_called_once_with()
        parse_xml_.assert_called_once_with("<w:ftr>")
        _init_.assert_called_once_with(footer_part, "/word/footer24.xml",
                                       CT.WML_FOOTER, ftr, package_)
示例#4
0
    def it_can_create_a_new_footer_part(
        self, package_, _default_footer_xml_, parse_xml_, _init_
    ):
        ftr = element("w:ftr")
        package_.next_partname.return_value = "/word/footer24.xml"
        _default_footer_xml_.return_value = "<w:ftr>"
        parse_xml_.return_value = ftr

        footer_part = FooterPart.new(package_)

        package_.next_partname.assert_called_once_with("/word/footer%d.xml")
        _default_footer_xml_.assert_called_once_with()
        parse_xml_.assert_called_once_with("<w:ftr>")
        _init_.assert_called_once_with(
            footer_part, "/word/footer24.xml", CT.WML_FOOTER, ftr, package_
        )
示例#5
0
 def add_footer_part(self):
     """Return (footer_part, rId) pair for newly-created footer part."""
     footer_part = FooterPart.new(self.package)
     rId = self.relate_to(footer_part, RT.FOOTER)
     return footer_part, rId
示例#6
0
 def add_footer_part(self):
     """Return (footer_part, rId) pair for newly-created footer part."""
     footer_part = FooterPart.new(self.package)
     rId = self.relate_to(footer_part, RT.FOOTER)
     return footer_part, rId