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

test_result: pylint py3

parent 182a10fa
...@@ -42,7 +42,6 @@ class CloudPerformanceUnitTestDistributor(ERP5ProjectUnitTestDistributor): ...@@ -42,7 +42,6 @@ class CloudPerformanceUnitTestDistributor(ERP5ProjectUnitTestDistributor):
all test nodes runs all test suites, this is not a problem to keep all test nodes runs all test suites, this is not a problem to keep
configuration configuration
""" """
pass
security.declarePublic("optimizeConfiguration") security.declarePublic("optimizeConfiguration")
def optimizeConfiguration(self): def optimizeConfiguration(self):
......
...@@ -68,15 +68,15 @@ class TestSuite(XMLObject, PeriodicityMixin): ...@@ -68,15 +68,15 @@ class TestSuite(XMLObject, PeriodicityMixin):
# setting of some properties that were defined with type "lines" instead of "string". # setting of some properties that were defined with type "lines" instead of "string".
# This was making the property existence constraint not working properly. # This was making the property existence constraint not working properly.
def _fixPropertyConsistency(self): def _fixPropertyConsistency(self):
self = aq_base(self) aq_base_self = aq_base(self)
for property_name in ('additional_bt5_repository_id', 'test_suite'): for property_name in ('additional_bt5_repository_id', 'test_suite'):
property_value = getattr(self, property_name, None) property_value = getattr(aq_base_self, property_name, None)
if property_value is not None and isinstance(property_value, tuple): if property_value is not None and isinstance(property_value, tuple):
if len(property_value) > 0: if len(property_value) > 0:
property_value = property_value[0] property_value = property_value[0]
setattr(self, property_name, property_value) setattr(aq_base_self, property_name, property_value)
else: else:
delattr(self, property_name) delattr(aq_base_self, property_name)
def getAdditionalBt5RepositoryId(self, *args, **kw): def getAdditionalBt5RepositoryId(self, *args, **kw):
self._fixPropertyConsistency() self._fixPropertyConsistency()
......
...@@ -13,15 +13,15 @@ class TestSuiteRepository(XMLObject): ...@@ -13,15 +13,15 @@ class TestSuiteRepository(XMLObject):
# setting of some properties that were defined with type "lines" instead of "string". # setting of some properties that were defined with type "lines" instead of "string".
# This was making the property existence constraint not working properly. # This was making the property existence constraint not working properly.
def _fixPropertyConsistency(self): def _fixPropertyConsistency(self):
self = aq_base(self) aq_base_self = aq_base(self)
for property_name in ('branch', 'buildout_section_id', 'git_url', 'profile_path'): for property_name in ('branch', 'buildout_section_id', 'git_url', 'profile_path'):
property_value = getattr(self, property_name, None) property_value = getattr(aq_base_self, property_name, None)
if property_value is not None and isinstance(property_value, tuple): if property_value is not None and isinstance(property_value, tuple):
if len(property_value) > 0: if len(property_value) > 0:
property_value = property_value[0] property_value = property_value[0]
setattr(self, property_name, property_value) setattr(aq_base_self, property_name, property_value)
else: else:
delattr(self, property_name) delattr(aq_base_self, property_name)
def getBranch(self, *args, **kw): def getBranch(self, *args, **kw):
self._fixPropertyConsistency() self._fixPropertyConsistency()
......
...@@ -301,7 +301,7 @@ def TestResult_sendEmailNotification(self, mail_to=None, mail_from=None, ...@@ -301,7 +301,7 @@ def TestResult_sendEmailNotification(self, mail_to=None, mail_from=None,
" %s lines" % max_line_count) " %s lines" % max_line_count)
traceback_attachment[max_line_count:] = '', '', '(truncated) ...' traceback_attachment[max_line_count:] = '', '', '(truncated) ...'
content = '\n'.join(traceback_attachment) content = '\n'.join(traceback_attachment)
if isinstance(content, unicode): if not isinstance(content, bytes):
content = content.encode('utf8') content = content.encode('utf8')
attachment_list.append(dict(name='traceback.txt', attachment_list.append(dict(name='traceback.txt',
mime_type='text/plain', mime_type='text/plain',
......
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