def it_can_construct_a_new_relationships_element(self): rels = CT_Relationships.new() expected_xml = ( '<Relationships xmlns="http://schemas.openxmlformats.org/package' '/2006/relationships"/>\n' ) assert serialize_for_reading(rels) == 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 assert serialize_for_reading(rels) == expected_rels_xml
def actual_xml(elm): return serialize_for_reading(elm)
def it_returns_unicode_text(self, type_fixture): element = type_fixture xml_text = serialize_for_reading(element) assert isinstance(xml_text, Unicode)
def it_pretty_prints_an_lxml_element(self, pretty_fixture): element, expected_xml_text = pretty_fixture xml_text = serialize_for_reading(element) assert xml_text == expected_xml_text