testtools, uitest, unotest: fix issues found by Ruff linter
Change-Id: I4a848b0f1f114d1262b5242786e088eb50a33cef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171145 Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Tested-by: Jenkins
This commit is contained in:
parent
ac41bc3c90
commit
d7628892b0
6 changed files with 38 additions and 38 deletions
|
@ -46,21 +46,21 @@ def equalsEps( a,b,eps ):
|
|||
|
||||
def assign( rData, bBool, cChar, nByte, nShort, nUShort, nLong, nULong, nHyper,\
|
||||
nUHyper, fFloat, fDouble, eEnum, rStr, xTest, rAny ):
|
||||
rData.Bool = bBool;
|
||||
rData.Char = cChar;
|
||||
rData.Byte = nByte;
|
||||
rData.Short = nShort;
|
||||
rData.UShort = nUShort;
|
||||
rData.Long = nLong;
|
||||
rData.ULong = nULong;
|
||||
rData.Hyper = nHyper;
|
||||
rData.UHyper = nUHyper;
|
||||
rData.Float = fFloat;
|
||||
rData.Double = fDouble;
|
||||
rData.Enum = eEnum;
|
||||
rData.String = rStr;
|
||||
rData.Interface = xTest;
|
||||
rData.Any = rAny;
|
||||
rData.Bool = bBool
|
||||
rData.Char = cChar
|
||||
rData.Byte = nByte
|
||||
rData.Short = nShort
|
||||
rData.UShort = nUShort
|
||||
rData.Long = nLong
|
||||
rData.ULong = nULong
|
||||
rData.Hyper = nHyper
|
||||
rData.UHyper = nUHyper
|
||||
rData.Float = fFloat
|
||||
rData.Double = fDouble
|
||||
rData.Enum = eEnum
|
||||
rData.String = rStr
|
||||
rData.Interface = xTest
|
||||
rData.Any = rAny
|
||||
|
||||
|
||||
class PythonTransporter:
|
||||
|
|
|
@ -32,21 +32,21 @@ g_attribs = "RuntimeException", "Bool", "Char", "Byte", "Short", "UShort", \
|
|||
|
||||
def assign( rData, bBool, cChar, nByte, nShort, nUShort, nLong, nULong, nHyper,\
|
||||
nUHyper, fFloat, fDouble, eEnum, rStr, xTest, rAny ):
|
||||
rData.Bool = bBool;
|
||||
rData.Char = cChar;
|
||||
rData.Byte = nByte;
|
||||
rData.Short = nShort;
|
||||
rData.UShort = nUShort;
|
||||
rData.Long = nLong;
|
||||
rData.ULong = nULong;
|
||||
rData.Hyper = nHyper;
|
||||
rData.UHyper = nUHyper;
|
||||
rData.Float = fFloat;
|
||||
rData.Double = fDouble;
|
||||
rData.Enum = eEnum;
|
||||
rData.String = rStr;
|
||||
rData.Interface = xTest;
|
||||
rData.Any = rAny;
|
||||
rData.Bool = bBool
|
||||
rData.Char = cChar
|
||||
rData.Byte = nByte
|
||||
rData.Short = nShort
|
||||
rData.UShort = nUShort
|
||||
rData.Long = nLong
|
||||
rData.ULong = nULong
|
||||
rData.Hyper = nHyper
|
||||
rData.UHyper = nUHyper
|
||||
rData.Float = fFloat
|
||||
rData.Double = fDouble
|
||||
rData.Enum = eEnum
|
||||
rData.String = rStr
|
||||
rData.Interface = xTest
|
||||
rData.Any = rAny
|
||||
|
||||
class MyRecursiveCall( XRecursiveCall, unohelper.Base ):
|
||||
def callRecursivly( xCall, nToCall ):
|
||||
|
|
|
@ -116,7 +116,7 @@ if __name__ == '__main__':
|
|||
if "-h" in opts or "--help" in opts:
|
||||
usage()
|
||||
sys.exit()
|
||||
elif not "--soffice" in opts:
|
||||
elif "--soffice" not in opts:
|
||||
usage()
|
||||
sys.exit(1)
|
||||
elif "--dir" in opts:
|
||||
|
|
|
@ -46,7 +46,7 @@ class ul_Compiler:
|
|||
parent_hierarchy_count = 0
|
||||
last_parent = []
|
||||
flag_for_QuerySaveDialog = False
|
||||
math_element_selector_initializer= False;
|
||||
math_element_selector_initializer= False
|
||||
|
||||
def __init__(self, input_address, output_address):
|
||||
self.ui_dsl_mm = metamodel_from_file("ui_logger_dsl_grammar.tx")
|
||||
|
@ -961,7 +961,7 @@ class ul_Compiler:
|
|||
|
||||
def handle_math_element_selector(self, math_element_selector):
|
||||
|
||||
if( self.math_element_selector_initializer == False ):
|
||||
if not self.math_element_selector_initializer:
|
||||
# This part is for initializing the element selector in the Math application
|
||||
self.math_element_selector_initializer = True
|
||||
line = (
|
||||
|
|
|
@ -16,14 +16,14 @@ def testAppDialog(UITestCase, app, dialog):
|
|||
with UITestCase.ui_test.create_doc_in_start_center(app):
|
||||
with UITestCase.ui_test.execute_dialog_through_command(
|
||||
dialog['command'], close_button=dialog['closeButton']) as xDialog:
|
||||
if 'skipTestOK' in dialog and dialog['skipTestOK'] == True:
|
||||
if 'skipTestOK' in dialog and dialog['skipTestOK']:
|
||||
xOKBtn = None
|
||||
else:
|
||||
try:
|
||||
xOKBtn = xDialog.getChild("ok")
|
||||
if (get_state_as_dict(xOKBtn)["Enabled"] != "true"):
|
||||
xOKBtn = None
|
||||
except:
|
||||
except Exception:
|
||||
xOKBtn = None
|
||||
|
||||
if (xOKBtn is not None):
|
||||
|
@ -47,14 +47,14 @@ def testChartDialog(UITestCase, dialog):
|
|||
xObj, "COMMAND",
|
||||
mkPropertyValues({"COMMAND": dialog['command']}),
|
||||
close_button=dialog['closeButton']) as xDialog:
|
||||
if 'skipTestOK' in dialog and dialog['skipTestOK'] == True:
|
||||
if 'skipTestOK' in dialog and dialog['skipTestOK']:
|
||||
xOKBtn = None
|
||||
else:
|
||||
try:
|
||||
xOKBtn = xDialog.getChild("ok")
|
||||
if (get_state_as_dict(xOKBtn)["Enabled"] != "true"):
|
||||
xOKBtn = None
|
||||
except:
|
||||
except Exception:
|
||||
xOKBtn = None
|
||||
|
||||
if (xOKBtn is not None):
|
||||
|
|
|
@ -265,7 +265,7 @@ def retryInvoke(connection, test):
|
|||
connection.postTest()
|
||||
except KeyboardInterrupt:
|
||||
raise # Ctrl+C should work
|
||||
except:
|
||||
except Exception:
|
||||
print("retryInvoke: caught exception")
|
||||
raise Exception("FAILED retryInvoke")
|
||||
|
||||
|
|
Loading…
Reference in a new issue