[Libreoffice-commits] core.git: sw/qa

slideon adamkasztenny at gmail.com
Tue Apr 5 10:33:30 UTC 2016


 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(-)

New commits:
commit d513cd3bf635af857624b8c8e693f82f3073e0b4
Author: slideon <adamkasztenny at gmail.com>
Date:   Wed Mar 30 22:23:56 2016 -0400

    tdf#97361 Fix check_table and remove = None assignments
    
    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 <ci at libreoffice.org>
    Reviewed-by: Björn Michaelsen <bjoern.michaelsen at canonical.com>

diff --git a/sw/qa/python/check_change_color.py b/sw/qa/python/check_change_color.py
index add544b..d0700f1 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 4d3076c..bdbd812 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 c1b63fb..cdc741e 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 13283ef..262c4bd 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 089aa2d..3db6615 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 6a24ff7..db32799 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 b6b3ff1..2868885 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):


More information about the Libreoffice-commits mailing list