Example #1
0
 def test_getting_tables_from_pptx(self):
     granulator = GranulateOpenXML(File(data=TWO_TABLES_PPTX_DATA,
                                        filename='two_tables.pptx'))
     files_with_single_tables = granulator.getTableDocumentList()
     first_file = files_with_single_tables[0]
     document_xml = first_file.read('word/document.xml')
     xml_root = etree.fromstring(document_xml)
     tbl_tags = xml_root.xpath('//w:tbl', namespaces=xml_root.nsmap)
     self.assertEquals(len(tbl_tags), 1)
     self.assertEquals(len(files_with_single_tables), 2)