summaryrefslogtreecommitdiff
path: root/uitest
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-01-14 10:59:16 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-01-25 00:35:56 +0100
commit6c98339f7523db93ff8064282c19ab285d80612a (patch)
tree69a4a862bd48f0f3f0abf7d662c1b80fb03c728a /uitest
parent21248f909e890df8ad50a0d9c18876125bb12c90 (diff)
uitest: some pep8 fixes
Change-Id: Ib889604f1b6d11e874c27fb5d2757a792a687366
Diffstat (limited to 'uitest')
-rw-r--r--uitest/libreoffice/connection.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/uitest/libreoffice/connection.py b/uitest/libreoffice/connection.py
index c717632b3b23..64f1dd94a063 100644
--- a/uitest/libreoffice/connection.py
+++ b/uitest/libreoffice/connection.py
@@ -22,6 +22,7 @@ except ImportError:
print("URE_BOOTSTRAP=file:///installation/opt/program/fundamentalrc")
raise
+
class OfficeConnection:
def __init__(self, args):
self.args = args
@@ -50,10 +51,10 @@ class OfficeConnection:
self.xContext = self.connect(socket)
def bootstrap(self, soffice, userdir, socket):
- argv = [ soffice, "--accept=" + socket + ";urp",
+ argv = [soffice, "--accept=" + socket + ";urp",
"-env:UserInstallation=" + userdir,
"--quickstart=no", "--nofirststartwizard",
- "--norestore", "--nologo" ]
+ "--norestore", "--nologo"]
if "--valgrind" in self.args:
argv.append("--valgrind")
@@ -80,7 +81,6 @@ class OfficeConnection:
try:
xContext = xUnoResolver.resolve(url)
return xContext
-# except com.sun.star.connection.NoConnectException
except pyuno.getClass("com.sun.star.connection.NoConnectException"):
print("NoConnectException: sleeping...")
time.sleep(1)
@@ -95,7 +95,6 @@ class OfficeConnection:
"com.sun.star.frame.Desktop", self.xContext)
xDesktop.terminate()
print("...done")
-# except com.sun.star.lang.DisposedException:
except pyuno.getClass("com.sun.star.beans.UnknownPropertyException"):
print("caught UnknownPropertyException while TearDown")
pass # ignore, also means disposed
@@ -144,23 +143,29 @@ class PersistentConnection:
def __init__(self, args):
self.args = args
self.connection = None
+
def getContext(self):
return self.connection.xContext
+
def setUp(self):
assert(not self.connection)
conn = OfficeConnection(self.args)
conn.setUp()
self.connection = conn
+
def preTest(self):
assert(self.connection)
+
def postTest(self):
assert(self.connection)
+
def tearDown(self):
if self.connection:
try:
self.connection.tearDown()
finally:
self.connection = None
+
def kill(self):
if self.connection and self.connection.soffice:
self.connection.soffice.kill()