diff options
| author | Michael Williamson <mike@zwobble.org> | 2013-12-03 00:02:50 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2013-12-03 00:02:50 +0000 |
| commit | 61bc4fdd82a04da73aa61a5416ac2fa65fb9e237 (patch) | |
| tree | 7110808fb27f65f1ad5611ab372620b0067eb61a /tests | |
| parent | 8717dd906667c5bf7a6c11f202ab475b14456990 (diff) | |
Add parsing of relationships XML
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/docx/relationships_xml_tests.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/docx/relationships_xml_tests.py b/tests/docx/relationships_xml_tests.py new file mode 100644 index 0000000..7e24491 --- /dev/null +++ b/tests/docx/relationships_xml_tests.py @@ -0,0 +1,21 @@ +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, Relationships, Relationship + + +@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( + Relationship(target="http://example.com"), + relationships["rId8"], + ) |
