Commit c4e684f4 authored by Rafael Monnerat's avatar Rafael Monnerat

Create setUp method (like unittest, to call configuration methods). Some...

Create setUp method (like unittest, to call configuration methods). Some projects can have diferent setups, but It is preferred to have same main function.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32329 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4bcdd441
...@@ -51,7 +51,6 @@ bt5_dir_list = ','.join([ ...@@ -51,7 +51,6 @@ bt5_dir_list = ','.join([
os.path.join(instance_home, 'Products/ERP5/bootstrap'), os.path.join(instance_home, 'Products/ERP5/bootstrap'),
os.path.join(instance_home, 'bt5')]) os.path.join(instance_home, 'bt5')])
class FunctionalTestRunner: class FunctionalTestRunner:
""" """
Used to run Functional tests Used to run Functional tests
...@@ -134,10 +133,8 @@ class FunctionalTestRunner: ...@@ -134,10 +133,8 @@ class FunctionalTestRunner:
f.close() f.close()
return file_content return file_content
def main(self): def main(self):
self.setPreference() self.setUp()
self.unsubscribeFromTimerService()
self.launchFuntionalTest() self.launchFuntionalTest()
def launchFuntionalTest(self): def launchFuntionalTest(self):
...@@ -273,6 +270,10 @@ user_pref("capability.principal.codebase.p1.subjectName", "");""" % \ ...@@ -273,6 +270,10 @@ user_pref("capability.principal.codebase.p1.subjectName", "");""" % \
'&__ac_name=%s&__ac_password=%s' % '&__ac_name=%s&__ac_password=%s' %
(self.portal_url, self.user, self.password)) (self.portal_url, self.user, self.password))
def setUp(self):
self.setPreference()
self.unsubscribeFromTimerService()
def sendResult(self): def sendResult(self):
result_uri = urllib2.urlopen('%s/portal_tests/TestTool_getResults' % self.portal_url).readline() result_uri = urllib2.urlopen('%s/portal_tests/TestTool_getResults' % self.portal_url).readline()
print result_uri print result_uri
...@@ -309,8 +310,10 @@ Following tests failed: ...@@ -309,8 +310,10 @@ Following tests failed:
if error_result_re.match(e): if error_result_re.match(e):
detail += e detail += e
detail = image_re.sub('', detail) detail = image_re.sub('', detail)
detail = detail.replace('<tr class="title status_failed"', '<tr class="title status_failed" style="background-color:red"') detail = detail.replace('<tr class="title status_failed"',
detail = detail.replace('<tr class="status_failed"', '<tr class="status_failed" style="background-color:red"') '<tr class="title status_failed" style="background-color:red"')
detail = detail.replace('<tr class="status_failed"',
'<tr class="status_failed" style="background-color:red"')
if detail: if detail:
detail = '<html><body>%s</body></html>' % detail detail = '<html><body>%s</body></html>' % detail
status = (not failures) status = (not failures)
......
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