summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-03-30 16:58:37 +0200
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-03-30 23:20:19 +0200
commit2f95d196bf28471810ccce1503fd0ff379cccc4b (patch)
tree5d637c669b9cd4b6c4f8eab84a2574766ca37f14 /sw
parent394c3f32aff2ef4ee06dcb897fbcd1a939d04384 (diff)
add Python test for table describtions
Change-Id: Ie7637b8cf26e663bbb47f0df9fdb441a8af754c5
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/python/check_table.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/sw/qa/python/check_table.py b/sw/qa/python/check_table.py
index 9ec6187d16cc..cd67edf96f76 100644
--- a/sw/qa/python/check_table.py
+++ b/sw/qa/python/check_table.py
@@ -254,6 +254,32 @@ class CheckTable(unittest.TestCase):
# close document
xDoc.dispose()
+ def test_descriptions(self):
+ xDoc = self.__class__._xDoc
+ # insert table
+ xTable = xDoc.createInstance("com.sun.star.text.TextTable")
+ xTable.initialize(3, 3)
+ xCursor = xDoc.Text.createTextCursor()
+ xDoc.Text.insertTextContent(xCursor, xTable, False)
+ self.assertEqual(3, xTable.Rows.Count)
+ self.assertEqual(3, xTable.Columns.Count)
+ for x in range(3):
+ for y in range(3):
+ xCell = xTable.getCellByPosition(x, y)
+ xCell.String = 'Cell %d %d' % (x, y)
+ self.assertEqual('Cell 0 0', xTable.getCellByPosition(0,0).String)
+ self.assertEqual('Cell 1 1', xTable.getCellByPosition(1,1).String)
+ self.assertEqual('Cell 2 2', xTable.getCellByPosition(2,2).String)
+ xTable.ChartColumnAsLabel = True
+ xTable.ChartRowAsLabel = True
+ self.assertEqual(2, len(xTable.RowDescriptions))
+ self.assertEqual('Cell 0 1', xTable.RowDescriptions[0])
+ self.assertEqual('Cell 0 2', xTable.RowDescriptions[1])
+ self.assertEqual(2, len(xTable.ColumnDescriptions))
+ self.assertEqual('Cell 1 0', xTable.ColumnDescriptions[0])
+ self.assertEqual('Cell 2 0', xTable.ColumnDescriptions[1])
+
+
if __name__ == '__main__':
unittest.main()