[Libreoffice-commits] core.git: sfx2/qa sw/qa
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Wed Apr 7 16:21:02 UTC 2021
sfx2/qa/uitest/doc/objserv.py | 8 +-------
sw/qa/uitest/writer_tests4/tdf138546.py | 6 ++----
sw/qa/uitest/writer_tests7/tdf137803.py | 8 +-------
sw/qa/uitest/writer_tests7/tdf140117.py | 8 +-------
sw/qa/uitest/writer_tests7/tdf141158.py | 8 +-------
sw/qa/uitest/writer_tests7/tdf46561.py | 7 +------
6 files changed, 7 insertions(+), 38 deletions(-)
New commits:
commit bd78ce123cd65fb8d0843df1d2530a168d5d464d
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Wed Apr 7 10:31:13 2021 +0200
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Wed Apr 7 18:20:17 2021 +0200
uitest: remove duplicated code
Change-Id: I86a4cd75e103445a288ad52a8c2167fa5b20c794
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113720
Tested-by: Xisco Fauli <xiscofauli at libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/sfx2/qa/uitest/doc/objserv.py b/sfx2/qa/uitest/doc/objserv.py
index 692d0fb88e17..58ac79aebe20 100644
--- a/sfx2/qa/uitest/doc/objserv.py
+++ b/sfx2/qa/uitest/doc/objserv.py
@@ -5,13 +5,7 @@
#
from uitest.framework import UITestCase
-import org.libreoffice.unotest
-import pathlib
-
-
-def get_url_for_data_file(file_name):
- return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
-
+from uitest.uihelper.common import get_url_for_data_file
# Test for sfx2/source/doc/objserv.cxx.
class Test(UITestCase):
diff --git a/sw/qa/uitest/writer_tests4/tdf138546.py b/sw/qa/uitest/writer_tests4/tdf138546.py
index c94f7eed3d48..0513d8c7600c 100644
--- a/sw/qa/uitest/writer_tests4/tdf138546.py
+++ b/sw/qa/uitest/writer_tests4/tdf138546.py
@@ -8,10 +8,8 @@ from uitest.framework import UITestCase
from uitest.uihelper.common import change_measurement_unit
from uitest.uihelper.common import get_state_as_dict, type_text
from uitest.uihelper.common import select_pos
-import org.libreoffice.unotest
-import pathlib
-def get_url_for_data_file(file_name):
- return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_url_for_data_file
+
class tdf138546(UITestCase):
def test_tdf138546(self):
self.ui_test.load_file(get_url_for_data_file("tdf138546.odt"))
diff --git a/sw/qa/uitest/writer_tests7/tdf137803.py b/sw/qa/uitest/writer_tests7/tdf137803.py
index 2c3f0fcb3713..d3eef57ead81 100644
--- a/sw/qa/uitest/writer_tests7/tdf137803.py
+++ b/sw/qa/uitest/writer_tests7/tdf137803.py
@@ -7,13 +7,7 @@
from uitest.framework import UITestCase
from libreoffice.uno.propertyvalue import mkPropertyValues
from uitest.uihelper.common import get_state_as_dict
-import importlib
-import time
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
- return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_url_for_data_file
class tdf137803(UITestCase):
def test_tdf137803(self):
diff --git a/sw/qa/uitest/writer_tests7/tdf140117.py b/sw/qa/uitest/writer_tests7/tdf140117.py
index c86d11091364..58db4c4caf79 100644
--- a/sw/qa/uitest/writer_tests7/tdf140117.py
+++ b/sw/qa/uitest/writer_tests7/tdf140117.py
@@ -9,13 +9,7 @@ from libreoffice.uno.propertyvalue import mkPropertyValues
from uitest.uihelper.common import get_state_as_dict
from uitest.uihelper.common import select_pos
from uitest.uihelper.common import type_text
-import importlib
-import time
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
- return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_url_for_data_file
class tdf140117(UITestCase):
def test_tdf140117(self):
diff --git a/sw/qa/uitest/writer_tests7/tdf141158.py b/sw/qa/uitest/writer_tests7/tdf141158.py
index 906035e37e89..e29c36418958 100644
--- a/sw/qa/uitest/writer_tests7/tdf141158.py
+++ b/sw/qa/uitest/writer_tests7/tdf141158.py
@@ -3,16 +3,10 @@
from uitest.framework import UITestCase
from libreoffice.uno.propertyvalue import mkPropertyValues
from uitest.uihelper.common import get_state_as_dict
-import importlib
-import pathlib
-import org.libreoffice.unotest
from uitest.uihelper.common import select_pos
+from uitest.uihelper.common import get_url_for_data_file
import time
-def get_url_for_data_file(file_name):
- return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
-
-
class TestTdf141158(UITestCase):
def test_tdf141158(self):
# load the desired bugdoc
diff --git a/sw/qa/uitest/writer_tests7/tdf46561.py b/sw/qa/uitest/writer_tests7/tdf46561.py
index 235136524903..1c90dc3c404a 100644
--- a/sw/qa/uitest/writer_tests7/tdf46561.py
+++ b/sw/qa/uitest/writer_tests7/tdf46561.py
@@ -8,12 +8,7 @@ from uitest.framework import UITestCase
from libreoffice.uno.propertyvalue import mkPropertyValues
from uitest.uihelper.common import select_pos
from uitest.uihelper.common import type_text
-import importlib
-import org.libreoffice.unotest
-import pathlib
-
-def get_url_for_data_file(file_name):
- return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri()
+from uitest.uihelper.common import get_url_for_data_file
class tdf46561(UITestCase):
def check_header_texts(self, master="", first="", left="", right=""):
More information about the Libreoffice-commits
mailing list