def can_overwrite_existing_style_map():
    fileobj = _normal_docx()
    write_style_map(fileobj, "p => h1")
    write_style_map(fileobj, "p => h2")
    with open_zip(fileobj, "r") as zip_file:
        assert_equal("p => h2", read_style_map(fileobj))
        _assert_no_duplicates(zip_file._zip_file.namelist())
        assert_equal(expected_relationships_xml, _read_relationships_xml(fileobj))
        assert_equal(expected_content_types_xml, _read_content_types_xml(fileobj))
示例#2
0
def can_overwrite_existing_style_map():
    fileobj = _normal_docx()
    write_style_map(fileobj, "p => h1")
    write_style_map(fileobj, "p => h2")
    with open_zip(fileobj, "r") as zip_file:
        assert_equal("p => h2", read_style_map(fileobj))
        _assert_no_duplicates(zip_file._zip_file.namelist())
        assert_equal(expected_relationships_xml,
                     _read_relationships_xml(fileobj))
        assert_equal(expected_content_types_xml,
                     _read_content_types_xml(fileobj))
def embedded_style_map_can_be_read_after_being_written():
    fileobj = _normal_docx()
    write_style_map(fileobj, "p => h1")
    assert_equal("p => h1", read_style_map(fileobj))
def reading_embedded_style_map_on_document_without_embedded_style_map_returns_none():
    fileobj = _normal_docx()
    assert_equal(None, read_style_map(fileobj))
示例#5
0
def embedded_style_map_can_be_read_after_being_written():
    fileobj = _normal_docx()
    write_style_map(fileobj, "p => h1")
    assert_equal("p => h1", read_style_map(fileobj))
示例#6
0
def reading_embedded_style_map_on_document_without_embedded_style_map_returns_none(
):
    fileobj = _normal_docx()
    assert_equal(None, read_style_map(fileobj))