Commit 418be70e authored by Jérome Perrin's avatar Jérome Perrin

cleanups, remove unused code and duplicate definition of getSvnRevision


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35927 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2f7101b5
......@@ -26,13 +26,7 @@
#
##############################################################################
#
# Prepare ERP5 Zelenium Test.
#
# usage: python runUnitTest.py --save [OPTION]... prepareFunctionalTest.py
#
import os, os.path
import os
import unittest
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
......@@ -49,26 +43,8 @@ class FunctionalTestRunner(FunctionalTestRunnerBase):
self.host = host
self.port = int(port)
def getSvnRevision(self):
# we should get the revision of a business template, but this is good
# enough for now.
import pysvn
revision = pysvn.Client().info(os.path.dirname(__file__)).revision.number
return revision
os.environ['erp5_tests_portal_id'] = 'erp5_portal'
MSG = '''
This "test file" is intended to be used with --save option, for use with
runFunctionalTest.py.
It will now enter an IPython prompt so you can explore the environment either
through IPython or through the "ZServer port" reported above.
Once you exit the IPython prompt, this "test" will finish.
'''.strip()
class TestZelenium(ERP5TypeTestCase):
def getBusinessTemplateList(self):
"""
......@@ -103,9 +79,7 @@ class TestZelenium(ERP5TypeTestCase):
runner_arguments)
self.runner.main()
self.runner.sendResult()
#print MSG
#import IPython.Shell
#IPython.Shell.IPShellEmbed('')(local_ns=locals(), global_ns=globals())
def test_suite():
suite = unittest.TestSuite()
......
......@@ -85,8 +85,8 @@ class FunctionalTestRunner:
try:
opts, args = getopt.getopt(arguments,
"hsd", ["help", "stdout", "debug",
"email_to_address=", "host=", "port=",
"portal_name=", "run_only=", "user=",
"email_to_address=", "host=", "port=",
"portal_name=", "run_only=", "user=",
"password=", "alarms=",
"email_subject=", "smtp_host=", "xvfb_display="] )
except getopt.GetoptError, msg:
......@@ -175,7 +175,7 @@ class FunctionalTestRunner:
os.system('%s/bin/zopectl stop' % self.instance_home)
def runXvfb(self, xvfb_display):
pid = os.spawnlp(os.P_NOWAIT, 'Xvfb', 'Xvfb',
pid = os.spawnlp(os.P_NOWAIT, 'Xvfb', 'Xvfb',
'-fbdir' , '%s' % self.xvfb_fbdir ,
':%s' % xvfb_display)
display = os.environ.get('DISPLAY')
......@@ -298,11 +298,9 @@ user_pref("capability.principal.codebase.p1.subjectName", "");""" % \
self.unsubscribeFromTimerService()
def getSvnRevision(self):
# get SVN revision used
"""Get svn revision used."""
import pysvn
os.chdir('%s/Products/ERP5' % self.instance_home)
revision = pysvn.Client().info('.').revision.number
return revision
return pysvn.Client().info(os.path.dirname(__file__)).revision.number
def sendResult(self):
result_uri = urllib2.urlopen('%s/portal_tests/TestTool_getResults' % self.portal_url).readline()
......
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