Kaydet (Commit) e21b2a61 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Fix Python file URL construction on Windows

...after d7628186 "Create temp copies of test
docs in Python/UITests"

Change-Id: I0f331ca9567e9a54842cc35b35628046d29b176d
Reviewed-on: https://gerrit.libreoffice.org/52470Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst a174caa5
import platform
import pathlib
import re
import unittest
from os import getenv, path
try:
from urllib.request import pathname2url
except ImportError:
from urllib import pathname2url
from org.libreoffice.unotest import pyuno, mkPropertyValue, makeCopyFromTDOC
......@@ -29,10 +24,8 @@ class InsertRemoveCells(unittest.TestCase):
('Hidden', True),
('ReadOnly', False)
))
tdoc_path = pathname2url(makeCopyFromTDOC('fdo74824.ods'))
if platform.system() == 'Windows':
tdoc_path = re.sub(r'^//(/[A-Za-z]:/)/', r'\1', tdoc_path)
url = 'file://' + tdoc_path
tdoc_path = makeCopyFromTDOC('fdo74824.ods')
url = pathlib.Path(tdoc_path).as_uri()
doc = desktop.loadComponentFromURL(url, "_blank", 0, load_props)
sheet = doc.Sheets.Sheet1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment