[Erp5-report] r8839 - /erp5/trunk/utils/erp5mechanize/runBenchmarks.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Jul 27 16:31:22 CEST 2006


Author: vincent
Date: Thu Jul 27 16:31:21 2006
New Revision: 8839

URL: http://svn.erp5.org?rev=8839&view=rev
Log:
Allow to pass parameters to test functions.

Modified:
    erp5/trunk/utils/erp5mechanize/runBenchmarks.py

Modified: erp5/trunk/utils/erp5mechanize/runBenchmarks.py
URL: http://svn.erp5.org/erp5/trunk/utils/erp5mechanize/runBenchmarks.py?rev=8839&r1=8838&r2=8839&view=diff
==============================================================================
--- erp5/trunk/utils/erp5mechanize/runBenchmarks.py (original)
+++ erp5/trunk/utils/erp5mechanize/runBenchmarks.py Thu Jul 27 16:31:21 2006
@@ -101,7 +101,7 @@
       if MAIN_IS_ALIVE == 0:
         return
       try:
-        result = test['function'](url=self.url, name=self.name, password=self.password, lazyness=self.lazyness)
+        result = test['function'](url=self.url, name=self.name, password=self.password, lazyness=self.lazyness, **test.get('kw', {}))
         self.test_result_list.append({'id': test['id'], 'step_list': result})
       except: # Don't let server error kill the whole test list - but notify that this test went wrong
         self.test_result_list.append({'id': test['id'], 'step_list': []})
@@ -285,7 +285,8 @@
     print "  instance_list ex: [{'url': 'http://127.0.0.1/erp5',"
     print "                      'user_list': [{'name': 'testuser1', 'password': 'secret'}]}]"
     print "  test_list     ex: [{'id': 'theFirstTest',"
-    print "                      'function': someStandaloneTestFunction}]"
+    print "                      'function': someStandaloneTestFunction,"
+    print "                      'kw': {'some_parameter': 'some_value_used_in_test_function'}}]"
     print "The test function has the following prototype :"
     print "  someStandaloneTestFunction(url, name, password) -> [TimeResult[, TimeResult[, ...]]]"
   try:




More information about the Erp5-report mailing list