Commit c020b284 authored by Jérome Perrin's avatar Jérome Perrin

ui_test_core: address pylint warnings and enable coding style test

See merge request !1589
parents 6bcc62ff 8846bfa2
# 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
......
for error_entry in context.error_log.getLogEntries():
for key in error_entry:
if key not in ["tb_text", "tb_html", 'req_html']:
print '%s : %s' % (key, error_entry[key])
print '------------- Traceback ------------'
print error_entry["tb_text"]
print "="*79
return printed
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ErrorLog_reportErrorList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -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)
......
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Zuite_viewZeleniumTestLauncher</string> </value> <value> <string>Zuite_viewRunZeleniumTestDialog</string> </value>
</item> </item>
<item> <item>
<key> <string>method</string> </key> <key> <string>method</string> </key>
......
...@@ -5,7 +5,7 @@ if web_page_context: ...@@ -5,7 +5,7 @@ if web_page_context:
form_id = 'view' form_id = 'view'
else: else:
no_web_page = not request.has_key('web_page') or request['web_page'] is None or not request['web_page'] no_web_page = not request.has_key('web_page') or request['web_page'] is None or not request['web_page']
form_id = 'Zuite_viewZeleniumTestLauncher' form_id = 'Zuite_viewRunZeleniumTestDialog'
no_reference = not request.has_key('web_page_reference') or request['web_page_reference'] is None or not request['web_page_reference'] no_reference = not request.has_key('web_page_reference') or request['web_page_reference'] is None or not request['web_page_reference']
no_url = not request.has_key('url') or request['url'] is None or not request['url'] no_url = not request.has_key('url') or request['url'] is None or not request['url']
......
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