[Neo-report] r2226 vincent - in /trunk/neo/tests: __init__.py functional/__init__.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Aug 26 20:48:26 CEST 2010


Author: vincent
Date: Thu Aug 26 20:48:22 2010
New Revision: 2226

Log:
Pick database parameters from environment.

Modified:
    trunk/neo/tests/__init__.py
    trunk/neo/tests/functional/__init__.py

Modified: trunk/neo/tests/__init__.py
==============================================================================
--- trunk/neo/tests/__init__.py [iso-8859-1] (original)
+++ trunk/neo/tests/__init__.py [iso-8859-1] Thu Aug 26 20:48:22 2010
@@ -26,10 +26,10 @@ from neo.protocol import Packets
 from time import time, gmtime
 from struct import pack, unpack
 
-DB_PREFIX = 'test_neo_'
-DB_ADMIN = 'root'
-DB_PASSWD = None
-DB_USER = 'test'
+DB_PREFIX = os.getenv('NEO_DB_PREFIX', 'test_neo_')
+DB_ADMIN = os.getenv('NEO_DB_ADMIN', 'root')
+DB_PASSWD = os.getenv('NEO_DB_PASSWD', None)
+DB_USER = os.getenv('NEO_DB_USER', 'test')
 
 class NeoTestBase(unittest.TestCase):
     """ Base class for neo tests, implements common checks """

Modified: trunk/neo/tests/functional/__init__.py
==============================================================================
--- trunk/neo/tests/functional/__init__.py [iso-8859-1] (original)
+++ trunk/neo/tests/functional/__init__.py [iso-8859-1] Thu Aug 26 20:48:22 2010
@@ -30,6 +30,7 @@ import threading
 from neo.neoctl.neoctl import NeoCTL, NotReadyException
 from neo.protocol import ClusterStates, NodeTypes, CellStates
 from neo.util import dump
+from neo.tests import DB_ADMIN, DB_PASSWD
 
 import neo
 # Replace neo.setupLog by a no-op function.
@@ -148,7 +149,7 @@ class NEOCluster(object):
     def __init__(self, db_list, master_node_count=1,
                  partitions=1, replicas=0, port_base=10000,
                  db_user='neo', db_password='neo',
-                 db_super_user='root', db_super_password=None,
+                 db_super_user=DB_ADMIN, db_super_password=DB_PASSWD,
                  cleanup_on_delete=False, temp_dir=None,
                  clear_databases=True, adapter='MySQL',
                  verbose=True):





More information about the Neo-report mailing list