aboutsummaryrefslogtreecommitdiff
path: root/tests/docx/relationships_xml_tests.py
blob: c3d0af0f69193d7730d66f122654f49a52c078ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from nose.tools import istest, assert_equal

from mammoth.docx.xmlparser import element as xml_element
from mammoth.docx.relationships_xml import read_relationships_xml_element


@istest
def target_is_read_from_relationship_element():
    element = xml_element("relationships:Relationships", {}, [
        xml_element("relationships:Relationship", {
            "Id": "rId8",
            "Type": "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",
            "Target": "http://example.com",
        })
    ])
    relationships = read_relationships_xml_element(element)
    assert_equal(
        "http://example.com",
        relationships.find_target_by_relationship_id("rId8"),
    )