コード例 #1
0
def test_restarts_numbering_for_all_elements_of_same_sequence():
    doc = FixtureDocument("numbering_with_paragraphs_in_between.docx")
    composed = ComposedDocument(
        "numbering_with_paragraphs_in_between.docx",
        "numbering_with_paragraphs_in_between.docx")

    assert composed == doc
コード例 #2
0
ファイル: test_styles.py プロジェクト: uonxhou/docxcompose
def test_styles_are_not_switched_for_first_numbering_element():
    doc = FixtureDocument("switched_listing_style.docx")
    composed = ComposedDocument(
        "master_switched_listing_style.docx", "switched_listing_style.docx")

    assert composed == doc
コード例 #3
0
ファイル: test_styles.py プロジェクト: uonxhou/docxcompose
def test_merged_styles_en():
    doc = FixtureDocument("styles_en.docx")
    composed = ComposedDocument(
        "styles_en.docx", "styles_de.docx")

    assert composed == doc
コード例 #4
0
def test_footnote():
    doc = FixtureDocument("footnote.docx")
    composed = ComposedDocument("master.docx", "footnote.docx")

    assert composed == doc
コード例 #5
0
def test_renumbering_of_non_visual_properties():
    expected = FixtureDocument("renumbering_nv_props.docx")
    composed = ComposedDocument("header_with_image.docx", "image.docx")

    assert composed == expected
コード例 #6
0
ファイル: test_section.py プロジェクト: uonxhou/docxcompose
def test_section_types_are_correct():
    composed = ComposedDocument("continous_section_break.docx",
                                "continous_section_break.docx")
    assert [s.start_type for s in composed.doc.sections] == [2, 0, 0]
コード例 #7
0
ファイル: test_section.py プロジェクト: uonxhou/docxcompose
def test_next_page_section_break():
    doc = FixtureDocument("next_page_section_break.docx")
    composed = ComposedDocument("next_page_section_break.docx",
                                "legacy_empty.docx")

    assert composed == doc
コード例 #8
0
ファイル: test_images.py プロジェクト: tsabbay/docxcompose
def test_images():
    doc = FixtureDocument("images.docx")
    composed = ComposedDocument("master.docx", "images.docx")

    assert composed == doc
コード例 #9
0
def test_numberings_styles():
    doc = FixtureDocument("numberings_styles.docx")
    composed = ComposedDocument("numberings_styles.docx",
                                "numberings_styles.docx")

    assert composed == doc
コード例 #10
0
def test_restart_numberings():
    doc = FixtureDocument("numberings_restart.docx")
    composed = ComposedDocument("numberings_restart.docx",
                                "numberings_restart.docx")

    assert composed == doc
コード例 #11
0
def test_numberings(static_reseed):
    doc = FixtureDocument("numberings.docx")
    composed = ComposedDocument("numberings.docx", "numberings.docx")

    assert composed == doc
コード例 #12
0
def test_hyperlinks():
    doc = FixtureDocument("embedded_excel_chart.docx")
    composed = ComposedDocument("master.docx", "embedded_excel_chart.docx")

    assert composed == doc
コード例 #13
0
def test_restart_numbering_manages_shared_style_names(static_reseed):
    doc = FixtureDocument("common_stylename_different_id.docx")
    composed = ComposedDocument("common_stylename_different_id1.docx",
                                "common_stylename_different_id2.docx")
    assert composed == doc
コード例 #14
0
def test_smartart():
    doc = FixtureDocument("smart_art.docx")
    composed = ComposedDocument("master.docx", "smart_art.docx")

    assert composed == doc
コード例 #15
0
def test_numbering_reference_to_numbering_zero():
    doc = FixtureDocument("numbering_reference_to_numbering_zero.docx")
    composed = ComposedDocument("numbering_reference_to_numbering_zero.docx",
                                "numbering_reference_to_numbering_zero.docx")

    assert composed == doc
コード例 #16
0
def test_hyperlinks():
    doc = FixtureDocument("hyperlinks.docx")
    composed = ComposedDocument("master.docx", "hyperlinks.docx")

    assert composed == doc
コード例 #17
0
def test_preserves_list_styles_when_restarting_nested_numberings():
    doc = FixtureDocument("broken_listing_nested.docx")
    composed = ComposedDocument("broken_listing_master.docx",
                                "broken_listing_nested.docx")

    assert composed == doc
コード例 #18
0
ファイル: test_section.py プロジェクト: uonxhou/docxcompose
def test_continuous_odd_section_break():
    doc = FixtureDocument("continous_odd_section_break.docx")
    composed = ComposedDocument("continous_section_break.docx",
                                "odd_section_break.docx")

    assert composed == doc
コード例 #19
0
def test_header_footer_sections():
    doc = FixtureDocument("header_footer_sections.docx")
    composed = ComposedDocument("header_footer_sections.docx",
                                "header_footer_sections.docx")

    assert composed == doc
コード例 #20
0
ファイル: test_section.py プロジェクト: uonxhou/docxcompose
def test_next_page_section_break_in_otherwise_empty_file_preseved():
    doc = FixtureDocument("next_page_section_break_empty.docx")
    composed = ComposedDocument("master.docx",
                                "next_page_section_break_empty.docx")

    assert composed == doc
コード例 #21
0
def test_footnotes_with_hyperlinks():
    doc = FixtureDocument("footnotes_with_hyperlinks.docx")
    composed = ComposedDocument("master.docx",
                                "footnotes_with_hyperlinks.docx")

    assert composed == doc
コード例 #22
0
def test_shapes():
    doc = FixtureDocument("embedded_visio.docx")
    composed = ComposedDocument("master.docx", "embedded_visio.docx")

    assert composed == doc
コード例 #23
0
def test_embedded_and_external_image():
    doc = FixtureDocument("embedded_and_external_image.docx")
    composed = ComposedDocument("master.docx",
                                "embedded_and_external_image.docx")

    assert composed == doc