sw/qa/python/check_flies.py | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-)
New commits: commit 70b70d07ad9205c8bc2a88e79935d7630873062a Author: Edmund Wong <ew...@crazy-cat.org> Date: Mon Jan 16 10:16:02 2017 +0800 Fix check_flies.py to be more pythonic Change-Id: Id5f44aaa97539b7ec97b81b39da30bd8d170c011 Reviewed-on: https://gerrit.libreoffice.org/33139 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Björn Michaelsen <bjoern.michael...@canonical.com> diff --git a/sw/qa/python/check_flies.py b/sw/qa/python/check_flies.py index 109d75b..55c04fe 100644 --- a/sw/qa/python/check_flies.py +++ b/sw/qa/python/check_flies.py @@ -16,18 +16,8 @@ the License at http://www.apache.org/licenses/LICENSE-2.0 . ''' -from com.sun.star.lang import XMultiServiceFactory -from com.sun.star.text import XTextDocument -from com.sun.star.text import XTextFramesSupplier -from com.sun.star.text import XTextGraphicObjectsSupplier -from com.sun.star.text import XTextEmbeddedObjectsSupplier -from com.sun.star.container import XNameAccess -from com.sun.star.container import NoSuchElementException -from com.sun.star.container import XIndexAccess from org.libreoffice.unotest import UnoInProcess import unittest -import unohelper -import os class CheckFlies(unittest.TestCase): @@ -65,11 +55,13 @@ class CheckFlies(unittest.TestCase): self.assertTrue(xEmbeddedFrames.hasByName(sFrameName), "Could not find embedded frame by name.") - self.assertTrue(not(vExpectedEmbeddedFrames), "Missing expected embedded frames.") + self.assertTrue(not(vExpectedEmbeddedFrames), + "Missing expected embedded frames.") xEmbeddedFramesIdx = xEmbeddedFrames - self.assertEqual(nEmbeddedFrames, len(xEmbeddedFramesIdx), "Unexpected number of embedded frames reported") + self.assertEqual(nEmbeddedFrames, len(xEmbeddedFramesIdx), + "Unexpected number of embedded frames reported") for nCurrentFrameIdx in range(len(xEmbeddedFramesIdx)): xEmbeddedFramesIdx.getByIndex(nCurrentFrameIdx) @@ -91,7 +83,8 @@ class CheckFlies(unittest.TestCase): "Missing expected graphics frames.") xGraphicFramesIdx = xGraphicFrames - self.assertEqual(nGraphicFrames, len(xGraphicFramesIdx), "Unexpected number of graphics frames reported") + self.assertEqual(nGraphicFrames, len(xGraphicFramesIdx), + "Unexpected number of graphics frames reported") for nCurrentFrameIdx in range(len(xGraphicFramesIdx)): xGraphicFramesIdx.getByIndex(nCurrentFrameIdx) @@ -115,7 +108,8 @@ class CheckFlies(unittest.TestCase): xTextFramesIdx = xTextFrames - self.assertEqual(nTextFrames, len(xTextFrames), "Unexpected number of text frames reported") + self.assertEqual(nTextFrames, len(xTextFrames), + "Unexpected number of text frames reported") for nCurrentFrameIdx in range(len(xTextFramesIdx)): xTextFramesIdx.getByIndex(nCurrentFrameIdx)
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits