本文整理汇总了Python中pydocx.test.utils.WordprocessingDocumentFactory.to_zip_dict方法的典型用法代码示例。如果您正苦于以下问题:Python WordprocessingDocumentFactory.to_zip_dict方法的具体用法?Python WordprocessingDocumentFactory.to_zip_dict怎么用?Python WordprocessingDocumentFactory.to_zip_dict使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pydocx.test.utils.WordprocessingDocumentFactory
的用法示例。
在下文中一共展示了WordprocessingDocumentFactory.to_zip_dict方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_document_property_is_a_Document_instance
# 需要导入模块: from pydocx.test.utils import WordprocessingDocumentFactory [as 别名]
# 或者: from pydocx.test.utils.WordprocessingDocumentFactory import to_zip_dict [as 别名]
def test_document_property_is_a_Document_instance(self):
factory = WordprocessingDocumentFactory()
factory.add(MainDocumentPart, '')
package = create_zip_archive(factory.to_zip_dict())
# TODO the interface for creating a new WordprocessingDocument sucks
document = WordprocessingDocument(path=package)
part = document.main_document_part
assert isinstance(part.document, Document), part.document
示例2: test_numbering_property_is_a_Numbering_instance
# 需要导入模块: from pydocx.test.utils import WordprocessingDocumentFactory [as 别名]
# 或者: from pydocx.test.utils.WordprocessingDocumentFactory import to_zip_dict [as 别名]
def test_numbering_property_is_a_Numbering_instance(self):
factory = WordprocessingDocumentFactory()
factory.add(NumberingDefinitionsPart, '')
factory.add(MainDocumentPart, '')
package = create_zip_archive(factory.to_zip_dict())
# TODO the interface for creating a new WordprocessingDocument sucks
document = WordprocessingDocument(path=package)
part = document.main_document_part.numbering_definitions_part
assert isinstance(part.numbering, Numbering), part.numbering