def test_parse_invalid(self): "Parsing invalid content." from lxml import etree with self.assertRaises(etree.XMLSyntaxError): parse_relationship(self.document, content_invalid)
def test_read_content(self): "Make sure content for rId6 is correct" parse_relationship(self.document, content_valid) self._assertRelationship('rId6', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image', 'media/image1.jpeg', 'Internal')
def test_parse_external(self): "Did we parse External reference" parse_relationship(self.document, content_external) self._assertRelationship('rId5', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink', 'http://www.google.com/', 'External')
def test_read_content(self): "Make sure content for rId6 is correct" parse_relationship(self.document, content_valid) self._assertRelationship( 'rId6', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image', 'media/image1.jpeg', 'Internal')
def test_parse_external(self): "Did we parse External reference" parse_relationship(self.document, content_external) self._assertRelationship( 'rId5', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink', 'http://www.google.com/', 'External')
def test_read_values(self): "Make sure we read all the values for rId6." parse_relationship(self.document, content_valid) self.assertEqual(len(self.document.relationships['rId6'].keys()), 3)
def test_parse(self): "Make sure we parse entire relationship file." parse_relationship(self.document, content_valid) self.assertEqual(len(self.document.relationships), 8)