diff options
author | slideon <adamkasztenny@gmail.com> | 2016-07-06 23:53:07 -0400 |
---|---|---|
committer | jan iversen <jani@documentfoundation.org> | 2016-07-07 06:39:05 +0000 |
commit | 9547d9f7ac91cbca162270d429b1e776aea5fc51 (patch) | |
tree | 604acacd861e12d47b158860672eb7509dfdf7e7 /sw/qa/python | |
parent | 296c74f61e5534898507529c8ebdd20d6dec73b9 (diff) |
Add test for XML Range Conversions
SwChartDataProvider's XML conversion methods were untested.
Also add tests for SwChartDataSequence's clone method and its get/
set property value methods.
Change-Id: I6323a7af1eae747592f5016b13fb5e2e3f0b71d1
Reviewed-on: https://gerrit.libreoffice.org/26995
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
Diffstat (limited to 'sw/qa/python')
-rw-r--r-- | sw/qa/python/check_table.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/sw/qa/python/check_table.py b/sw/qa/python/check_table.py index f7fdf5c35f7d..61b93583ab14 100644 --- a/sw/qa/python/check_table.py +++ b/sw/qa/python/check_table.py @@ -417,6 +417,7 @@ class CheckTable(unittest.TestCase): self.assertEqual(len(xDataSource.DataSequences), 3) expectedValues = ((1, 4), (2, 5), (3, 6)) expectedCellrange = ('A1:A2', 'B1:B2', 'C1:C2') + for col in range(3): xSeq = xDataSource.DataSequences[col].Values self.assertEqual(xSeq.ImplementationName, 'SwChartDataSequence') @@ -429,6 +430,13 @@ class CheckTable(unittest.TestCase): self.assertEqual( [int(txtval) for txtval in xSeq.TextualData], [val for val in expectedValues[col]]) + + xSeq.Role = "One xSeq to rule them all" + self.assertEqual("One xSeq to rule them all", xSeq.Role) + + xSeqClone = xSeq.createClone() + self.assertEqual(xSeq.Role, xSeqClone.Role) + xDoc.dispose() def test_tdf32082(self): @@ -543,6 +551,29 @@ class CheckTable(unittest.TestCase): xDoc.dispose() + def test_xmlRangeConversions(self): + xDoc = CheckTable._uno.openEmptyWriterDoc() + xTable = xDoc.createInstance("com.sun.star.text.TextTable") + xTable.initialize(4, 3) + xCursor = xDoc.Text.createTextCursor() + xDoc.Text.insertTextContent(xCursor, xTable, False) + xTable.ChartColumnAsLabel = False + xTable.ChartRowAsLabel = False + xTable.Data = ((1, 2, 3), (4, 5, 6), (7, 8, 9), (10, 11, 12)) + + xChartDataProvider = xDoc.createInstance('com.sun.star.chart2.data.DataProvider') + + self.assertEqual('', xChartDataProvider.convertRangeToXML('')) + self.assertEqual('', xChartDataProvider.convertRangeFromXML('')) + self.assertEqual('.A1;.A1', xChartDataProvider.convertRangeFromXML('<some xml>')) + + xml = xChartDataProvider.convertRangeToXML('Table1.A1:C3') + + self.assertEqual("Table1.$A$1:.$C$3", xml) + + xCellRangeString = xChartDataProvider.convertRangeFromXML("Table1.$A$1:.$C$3") + self.assertEqual("Table1.A1:C3", xCellRangeString) + if __name__ == '__main__': unittest.main() |