Beispiel #1
0
 def it_can_construct_a_new_relationships_element(self):
     rels = CT_Relationships.new()
     actual_xml = oxml_tostring(rels, encoding='unicode',
                                pretty_print=True)
     expected_xml = (
         '<Relationships xmlns="http://schemas.openxmlformats.org/package'
         '/2006/relationships"/>\n'
     )
     assert actual_xml == expected_xml
Beispiel #2
0
 def it_can_construct_a_new_relationships_element(self):
     rels = CT_Relationships.new()
     actual_xml = oxml_tostring(rels, encoding='unicode',
                                pretty_print=True)
     expected_xml = (
         '<Relationships xmlns="http://schemas.openxmlformats.org/package'
         '/2006/relationships"/>\n'
     )
     assert actual_xml == expected_xml
Beispiel #3
0
 def it_can_build_rels_element_incrementally(self):
     # setup ------------------------
     rels = CT_Relationships.new()
     # exercise ---------------------
     rels.add_rel("rId1", "http://reltype1", "docProps/core.xml")
     rels.add_rel("rId2", "http://linktype", "http://some/link", True)
     rels.add_rel("rId3", "http://reltype2", "../slides/slide1.xml")
     # verify -----------------------
     expected_rels_xml = a_Relationships().xml
     actual_xml = oxml_tostring(rels, encoding="unicode", pretty_print=True)
     assert actual_xml == expected_rels_xml
Beispiel #4
0
 def it_can_build_rels_element_incrementally(self):
     # setup ------------------------
     rels = CT_Relationships.new()
     # exercise ---------------------
     rels.add_rel("rId1", "http://reltype1", "docProps/core.xml")
     rels.add_rel("rId2", "http://linktype", "http://some/link", True)
     rels.add_rel("rId3", "http://reltype2", "../slides/slide1.xml")
     # verify -----------------------
     expected_rels_xml = a_Relationships().xml
     actual_xml = oxml_tostring(rels, encoding="unicode", pretty_print=True)
     assert actual_xml == expected_rels_xml
Beispiel #5
0
 def it_can_build_rels_element_incrementally(self):
     # setup ------------------------
     rels = CT_Relationships.new()
     # exercise ---------------------
     rels.add_rel('rId1', 'http://reltype1', 'docProps/core.xml')
     rels.add_rel('rId2', 'http://linktype', 'http://some/link', True)
     rels.add_rel('rId3', 'http://reltype2', '../slides/slide1.xml')
     # verify -----------------------
     expected_rels_xml = a_Relationships().xml
     actual_xml = oxml_tostring(rels, encoding='unicode', pretty_print=True)
     assert actual_xml == expected_rels_xml
Beispiel #6
0
 def it_can_build_rels_element_incrementally(self):
     # setup ------------------------
     rels = CT_Relationships.new()
     # exercise ---------------------
     rels.add_rel('rId1', 'http://reltype1', 'docProps/core.xml')
     rels.add_rel('rId2', 'http://linktype', 'http://some/link', True)
     rels.add_rel('rId3', 'http://reltype2', '../slides/slide1.xml')
     # verify -----------------------
     expected_rels_xml = a_Relationships().xml
     actual_xml = oxml_tostring(rels, encoding='unicode',
                                pretty_print=True)
     assert actual_xml == expected_rels_xml