diff --git a/product/ERP5Type/tests/prepareFunctionalTest.py b/product/ERP5Type/tests/prepareFunctionalTest.py index 754bac08a16f4e0a5d0781ebb4349556de11b6d3..3f61db8f0025fc8c4bb27542d0e47300c7353109 100755 --- a/product/ERP5Type/tests/prepareFunctionalTest.py +++ b/product/ERP5Type/tests/prepareFunctionalTest.py @@ -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() diff --git a/product/ERP5Type/tests/runFunctionalTest.py b/product/ERP5Type/tests/runFunctionalTest.py index 6e80c5f6244e49278ad86036a6264f4bb1953c26..4fd14d5ebb92b7c37148146926f7778d00d96afa 100755 --- a/product/ERP5Type/tests/runFunctionalTest.py +++ b/product/ERP5Type/tests/runFunctionalTest.py @@ -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()