[Erp5-report] r20448 - /experimental/FSPatch/Products/ERP5Type/tests/

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Apr 11 15:01:37 CEST 2008


Author: mikolaj
Date: Fri Apr 11 15:01:36 2008
New Revision: 20448

URL: http://svn.erp5.org?rev=20448&view=rev
Log:
now it will be possible to pass full connection string (with password) to unit test

Added:
    experimental/FSPatch/Products/ERP5Type/tests/utils_betterConecttionStringProcessing.diff

Added: experimental/FSPatch/Products/ERP5Type/tests/utils_betterConecttionStringProcessing.diff
URL: http://svn.erp5.org/experimental/FSPatch/Products/ERP5Type/tests/utils_betterConecttionStringProcessing.diff?rev=20448&view=auto
==============================================================================
--- experimental/FSPatch/Products/ERP5Type/tests/utils_betterConecttionStringProcessing.diff (added)
+++ experimental/FSPatch/Products/ERP5Type/tests/utils_betterConecttionStringProcessing.diff Fri Apr 11 15:01:36 2008
@@ -1,0 +1,21 @@
+Index: utils.py
+===================================================================
+--- utils.py	(wersja 18850)
++++ utils.py	(kopia robocza)
+@@ -196,8 +196,14 @@
+   connection_string = os.environ.get('erp5_sql_connection_string')
+   if not connection_string:
+     return '-u test test'
+-  db, user = connection_string.split()
+-  return '-u %s %s' % (user, db)
++  argument_list = connection_string.split()
++  if len(argument_list) < 2 or len(argument_list) > 3:
++    raise ValueError, "Bad connection string for erp5_sql_connection (not enough or too many arguments)."
++  if len(argument_list) == 2:
++    print 'WARNING - No password supplied for MySQL connection'
++    return '-u%s %s' % (argument_list[1], argument_list[0])
++  if len(argument_list) == 3:
++    return '-u%s -p%s %s' % (argument_list[1], argument_list[2], argument_list[0])
+ 
+ # decorators
+ class reindex(object):




More information about the Erp5-report mailing list