def test_delete(self): container = self.container content = XmlPart(ODF_CONTENT, container) paragraphs = content.get_elements("//text:p") for paragraph in paragraphs: content.delete_element(paragraph) serialized = content.serialize() self.assertEqual(serialized.count(b"<text:p"), 0)
def test_get_element_list(self): content_part = XmlPart(ODF_CONTENT, self.container) elements = content_part.get_elements("//text:p") # The annotation paragraph is counted self.assertEqual(len(elements), 8)