From d513cd3bf635af857624b8c8e693f82f3073e0b4 Mon Sep 17 00:00:00 2001 From: slideon Date: Wed, 30 Mar 2016 22:23:56 -0400 Subject: tdf#97361 Fix check_table and remove = None assignments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The = None (or null) pattern is a Java convention, its not needed in Python. Change-Id: I0041d4030db05234eeefc8606f571da38174f962 Reviewed-on: https://gerrit.libreoffice.org/23669 Tested-by: Jenkins Reviewed-by: Björn Michaelsen --- sw/qa/python/check_change_color.py | 2 -- sw/qa/python/check_index.py | 2 -- sw/qa/python/check_styles.py | 1 - sw/qa/python/check_table.py | 30 +++++++++++++++++------------- sw/qa/python/get_expression.py | 2 -- sw/qa/python/set_expression.py | 2 -- sw/qa/python/var_fields.py | 2 -- 7 files changed, 17 insertions(+), 24 deletions(-) diff --git a/sw/qa/python/check_change_color.py b/sw/qa/python/check_change_color.py index add544bff23c..d0700f104f7c 100644 --- a/sw/qa/python/check_change_color.py +++ b/sw/qa/python/check_change_color.py @@ -2,8 +2,6 @@ import unittest from org.libreoffice.unotest import UnoInProcess class CheckChangeColor(unittest.TestCase): - _uno = None - _xDoc = None @classmethod def setUpClass(cls): diff --git a/sw/qa/python/check_index.py b/sw/qa/python/check_index.py index 4d3076c43b9a..bdbd8121d128 100644 --- a/sw/qa/python/check_index.py +++ b/sw/qa/python/check_index.py @@ -22,8 +22,6 @@ class RefreshListener(XRefreshListener, unohelper.Base): self.m_bRefreshed = False class CheckIndex(unittest.TestCase): - _uno = None - _xDoc = None @classmethod def setUpClass(cls): diff --git a/sw/qa/python/check_styles.py b/sw/qa/python/check_styles.py index c1b63fb53e04..cdc741ee6a92 100644 --- a/sw/qa/python/check_styles.py +++ b/sw/qa/python/check_styles.py @@ -16,7 +16,6 @@ from com.sun.star.lang import IllegalArgumentException class CheckStyle(unittest.TestCase): - _uno = None @classmethod def setUpClass(cls): diff --git a/sw/qa/python/check_table.py b/sw/qa/python/check_table.py index 13283efdd165..262c4bd8cb9b 100644 --- a/sw/qa/python/check_table.py +++ b/sw/qa/python/check_table.py @@ -20,24 +20,29 @@ class CheckTable(unittest.TestCase): for x in range(3): for y in range(3): self.assertEqual('Cell %d %d' % (x, y), xTable.getCellByPosition(x, y).String) + + @classmethod def setUpClass(cls): cls._uno = UnoInProcess() cls._uno.setUp() + cls.OOLineHairline = 2 + @classmethod def tearDownClass(cls): cls._uno.tearDown() - def __test_borderAsserts(self, typeOfLine, lineValid): + def __test_borderAsserts(self, xBorderLine, lineValid): self.assertTrue(lineValid) - self.assertEqual(0, typeOfLine.InnerLineWidth) - self.assertEqual(2, typeOfLine.OuterLineWidth) - self.assertEqual(0, typeOfLine.LineDistance) - self.assertEqual(0, typeOfLine.Color) + self.assertEqual(0, xBorderLine.InnerLineWidth) + self.assertEqual(self.OOLineHairline, xBorderLine.OuterLineWidth) + self.assertEqual(0, xBorderLine.LineDistance) + self.assertEqual(0, xBorderLine.Color) - def __test_borderAssertsWithLineStyle(self, typeOfLine, lineValid): - self.__test_borderAsserts(typeOfLine, lineValid) - self.assertEqual(SOLID, typeOfLine.LineStyle) + def __test_borderAssertsWithLineStyle(self, xBorderLine, lineValid): + self.__test_borderAsserts(xBorderLine, lineValid) + self.assertEqual(self.OOLineHairline, xBorderLine.LineWidth) + self.assertEqual(SOLID, xBorderLine.LineStyle) def __test_borderDistance(self, border): self.assertTrue(border.IsDistanceValid) @@ -61,8 +66,8 @@ class CheckTable(unittest.TestCase): self.__test_borderAsserts(border.HorizontalLine, border.IsHorizontalLineValid) self.__test_borderAsserts(border.VerticalLine, border.IsVerticalLineValid) - self.assertTrue(border.IsDistanceValid) - self.assertEqual(97, border.Distance) + self.__test_borderDistance(border) + # set border border.TopLine = BorderLine(0, 11, 19, 19) border.BottomLine = BorderLine(0xFF, 00, 11, 00) @@ -97,8 +102,7 @@ class CheckTable(unittest.TestCase): self.__test_borderAsserts(border.VerticalLine, border.IsVerticalLineValid) - self.assertTrue(border.IsDistanceValid) - self.assertEqual(97, border.Distance) + self.__test_borderDistance(border) border2 = xTable.getPropertyValue("TableBorder2") self.assertTrue(border2.IsTopLineValid) @@ -131,7 +135,7 @@ class CheckTable(unittest.TestCase): self.__test_borderAssertsWithLineStyle(border2.VerticalLine, border2.IsVerticalLineValid) - self.__test_borderDistance(border) + self.__test_borderDistance(border2) # set border2 border2.RightLine = BorderLine2(0, 0, 0, 0, THICKTHIN_LARGEGAP, 120) border2.LeftLine = BorderLine2(0, 0, 0, 0, EMBOSSED, 90) diff --git a/sw/qa/python/get_expression.py b/sw/qa/python/get_expression.py index 089aa2d08524..3db661547878 100644 --- a/sw/qa/python/get_expression.py +++ b/sw/qa/python/get_expression.py @@ -2,8 +2,6 @@ import unittest from org.libreoffice.unotest import UnoInProcess class TestGetExpression(unittest.TestCase): - _uno = None - _xDoc = None @classmethod def setUpClass(cls): diff --git a/sw/qa/python/set_expression.py b/sw/qa/python/set_expression.py index 6a24ff7b0b90..db32799fb47c 100644 --- a/sw/qa/python/set_expression.py +++ b/sw/qa/python/set_expression.py @@ -3,8 +3,6 @@ from org.libreoffice.unotest import UnoInProcess #@unittest.skip("that seems to work") class TestSetExpresion(unittest.TestCase): - _uno = None - _xDoc = None @classmethod def setUpClass(cls): diff --git a/sw/qa/python/var_fields.py b/sw/qa/python/var_fields.py index b6b3ff15e2ef..28688858c52a 100644 --- a/sw/qa/python/var_fields.py +++ b/sw/qa/python/var_fields.py @@ -4,8 +4,6 @@ from org.libreoffice.unotest import UnoInProcess from com.sun.star.text.ControlCharacter import PARAGRAPH_BREAK class TestVarFields(unittest.TestCase): - _uno = None - _xDoc = None @classmethod def setUpClass(cls): -- cgit v1.2.3