Commit 8846bfa2 authored by Jérome Perrin's avatar Jérome Perrin

ui_test_core: address pylint warnings and enable coding style test

parent 182f833d
Pipeline #20841 passed with stage
in 0 seconds
# pylint:disable=redefined-builtin
# select_language is a builtin because of a Localizer.itools.i18n.accept patch
context.Base_doLanguage(select_language) context.Base_doLanguage(select_language)
# Don't redirect. Base_doLanguage tries to redirect to the same page # Don't redirect. Base_doLanguage tries to redirect to the same page
# and then selenium main page is loaded again in the bottom frame of # and then selenium main page is loaded again in the bottom frame of
......
...@@ -7,7 +7,13 @@ if REQUEST: ...@@ -7,7 +7,13 @@ if REQUEST:
assert context.getPortalType() == "Test Tool", "bad context" assert context.getPortalType() == "Test Tool", "bad context"
if test_id is None or test_id == '': if test_id is None or test_id == '':
test_id = ''.join(list(filter(lambda a: a not in ["'",'_', '-','.',' ','~', ':', '/', '?', '#', '[', ']', '@', '!', '$', '&', '(', ')', '*','+',';','='], title))) test_id = ''.join(
list(
filter( # pylint:disable=deprecated-lambda
lambda a: a not in [
"'", '_', '-', '.', ' ', '~', ':', '/', '?', '#', '[', ']', '@', '!',
'$', '&', '(', ')', '*', '+', ';', '='
], title)))
if test_id not in context.objectIds(): if test_id not in context.objectIds():
factory = context.manage_addProduct['PageTemplates'] factory = context.manage_addProduct['PageTemplates']
......
...@@ -6,13 +6,13 @@ test_list = [] ...@@ -6,13 +6,13 @@ test_list = []
count = 0 count = 0
portal = context.getPortalObject() portal = context.getPortalObject()
for url in url_list: for url in url_list:
count += 1 count += 1
if "http" not in url: if "http" not in url:
# local content # local content
data = portal.restrictedTraverse(url).TestPage_viewSeleniumTest() data = portal.restrictedTraverse(url).TestPage_viewSeleniumTest()
else: else:
data = context.Zuite_urlRead(url, safe_return=1) data = context.Zuite_urlRead(url, safe_return=1)
test_list.append((data, '%s %s' % (count, url)),) test_list.append((data, '%s %s' % (count, url)),)
return context.Zuite_createAndLaunchSeleniumTest(test_list=test_list, return context.Zuite_createAndLaunchSeleniumTest(test_list=test_list,
zuite_id=zuite_id) zuite_id=zuite_id)
""" """
Upload a screenshot taken by the test to ERP5 Upload a screenshot taken by the test to ERP5
""" """
from erp5.component.module.Log import log
data_uri = context.REQUEST.form.get('data_uri', 'default') data_uri = context.REQUEST.form.get('data_uri', 'default')
image_module = getattr(context, "image_module", None) image_module = getattr(context, "image_module", None)
......
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