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
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
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