summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-02-14 17:50:20 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-02-14 16:46:07 +0100
commit7ce4a3956a570841d5967ba1e555ded5613b6bc4 (patch)
tree5a57ad0b11b229087310a6fcd4d9575e2ab02993 /sw
parent984a1827508e7298611476cf747c4acc96dec58a (diff)
Handle system paths and URLs properly
Avoids errors like this: make UITest_conditional_format ... Execution time for tdf117899.Tdf117899.test_tdf117899: 9.992 tearDown: calling terminate()... ...done ERROR ====================================================================== ERROR: test_tdf117899 (tdf117899.Tdf117899) ---------------------------------------------------------------------- Traceback (most recent call last): File "C:/lo/src/core/sc/qa/uitest/conditional_format/tdf117899.py", line 64, in test_tdf117899 self.ui_test.load_file('file://' + xFilePath) File "C:\lo\src\core\uitest\uitest\test.py", line 76, in load_file component = desktop.loadComponentFromURL(url, target, 0, tuple()) uitest.test.com.sun.star.lang.IllegalArgumentException: Unsupported URL <file://C:\cygwin64\tmp\tmpfs3x8j2r/tdf117899-temp.ods>: "type detection failed" ---------------------------------------------------------------------- Change-Id: Ifbf62c0aaa72412dc0efca921f59441d09c54d90 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110882 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/python/text_portion_enumeration_test.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/sw/qa/python/text_portion_enumeration_test.py b/sw/qa/python/text_portion_enumeration_test.py
index c379138db303..52b1c2c8b702 100644
--- a/sw/qa/python/text_portion_enumeration_test.py
+++ b/sw/qa/python/text_portion_enumeration_test.py
@@ -3282,9 +3282,7 @@ class TextPortionEnumerationTest(unittest.TestCase):
if xComp:
self.checkloadmeta(xComp)
with TemporaryDirectory() as tempdir:
- if os.altsep: # we need URL so replace "\" with "/"
- tempdir = tempdir.replace(os.sep, os.altsep)
- file = tempdir + "/" + filename
+ file = os.path.join(tempdir, filename)
self.dostore(xComp, file)
self.close(xComp)
xComp2 = None
@@ -3354,9 +3352,7 @@ class TextPortionEnumerationTest(unittest.TestCase):
if xComp:
self.checkloadxmlid(xComp)
with TemporaryDirectory() as tempdir:
- if os.altsep: # we need URL so replace "\" with "/"
- tempdir = tempdir.replace(os.sep, os.altsep)
- file = tempdir + "/" + filename
+ file = os.path.join(tempdir, filename)
self.dostore(xComp, file)
self.close(xComp)
xComp2 = None