Commit c6513e84 authored by Gabriel Monnerat's avatar Gabriel Monnerat

update methods name to follow changes in r44590

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@44655 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 639b7122
...@@ -61,11 +61,11 @@ class TestOOGranulator(HandlerTestCase): ...@@ -61,11 +61,11 @@ class TestOOGranulator(HandlerTestCase):
('SoccerTeams', 'Tabela 2: Soccer Teams')] ('SoccerTeams', 'Tabela 2: Soccer Teams')]
self.assertEquals(table_list, oogranulator.getTableItemList()) self.assertEquals(table_list, oogranulator.getTableItemList())
def testGetTableItem(self): def testGetTable(self):
"""Test if getTableItem() returns on odf file with the right table""" """Test if getTable() returns on odf file with the right table"""
data = open('./data/granulate_table_test.odt').read() data = open('./data/granulate_table_test.odt').read()
oogranulator = OOGranulator(data, 'odt') oogranulator = OOGranulator(data, 'odt')
table_data_doc = oogranulator.getTableItem('Developers') table_data_doc = oogranulator.getTable('Developers')
content_xml_str = ZipFile(StringIO(table_data_doc)).read('content.xml') content_xml_str = ZipFile(StringIO(table_data_doc)).read('content.xml')
content_xml = etree.fromstring(content_xml_str) content_xml = etree.fromstring(content_xml_str)
table_list = content_xml.xpath('//table:table', table_list = content_xml.xpath('//table:table',
...@@ -76,10 +76,10 @@ class TestOOGranulator(HandlerTestCase): ...@@ -76,10 +76,10 @@ class TestOOGranulator(HandlerTestCase):
self.assertEquals('Developers', table.attrib[name_key]) self.assertEquals('Developers', table.attrib[name_key])
def testGetTableItemWithoutSuccess(self): def testGetTableItemWithoutSuccess(self):
"""Test if getTableItem() returns None for an non existent table name""" """Test if getTable() returns None for an non existent table name"""
data = open('./data/granulate_table_test.odt').read() data = open('./data/granulate_table_test.odt').read()
oogranulator = OOGranulator(data, 'odt') oogranulator = OOGranulator(data, 'odt')
table_data = oogranulator.getTableItem('NonExistentTable') table_data = oogranulator.getTable('NonExistentTable')
self.assertEquals(table_data, None) self.assertEquals(table_data, None)
def testGetColumnItemList(self): def testGetColumnItemList(self):
...@@ -147,16 +147,16 @@ class TestOOGranulator(HandlerTestCase): ...@@ -147,16 +147,16 @@ class TestOOGranulator(HandlerTestCase):
def testGetParagraphItemSuccessfully(self): def testGetParagraphItemSuccessfully(self):
"""Test if getParagraphItem() returns the right paragraph""" """Test if getParagraphItem() returns the right paragraph"""
self.assertEquals(('Some images without title', 'P13'), self.assertEquals(('Some images without title', 'P13'),
self.oogranulator.getParagraphItem(8)) self.oogranulator.getParagraph(8))
big_paragraph = self.oogranulator.getParagraphItem(5) big_paragraph = self.oogranulator.getParagraph(5)
self.assertEquals('P8', big_paragraph[1]) self.assertEquals('P8', big_paragraph[1])
self.assertTrue(big_paragraph[0].startswith(u'A prática cotidiana prova')) self.assertTrue(big_paragraph[0].startswith(u'A prática cotidiana prova'))
self.assertTrue(big_paragraph[0].endswith(u'corresponde às necessidades.')) self.assertTrue(big_paragraph[0].endswith(u'corresponde às necessidades.'))
def testGetParagraphItemWithoutSuccess(self): def testGetParagraphItemWithoutSuccess(self):
"""Test if getParagraphItem() returns None for not existent id""" """Test if getParagraphItem() returns None for not existent id"""
self.assertEquals(None, self.oogranulator.getParagraphItem(200)) self.assertEquals(None, self.oogranulator.getParagraph(200))
def testGetChapterItemList(self): def testGetChapterItemList(self):
"""Test if getChapterItemList() returns the right chapters list""" """Test if getChapterItemList() returns the right chapters list"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment