Commit a6cde7db authored by Vincent Pelletier's avatar Vincent Pelletier

Move sql connection establishment to NEOCluster class, as it requires the...

Move sql connection establishment to NEOCluster class, as it requires the knowledge of SQL login & password.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@1233 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent d1e69aa9
......@@ -296,6 +296,11 @@ class NEOCluster(object):
db = ZODB.DB(storage=self.getZODBStorage())
return (db, db.open())
def getSQLConnection(self, db):
assert db in self.db_list
return MySQLdb.Connect(user=self.db_user, passwd=self.db_password,
db=db)
def _getProcessList(self, type):
return self.process_dict.get(type)
......
......@@ -16,7 +16,6 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import ZODB
import MySQLdb
import unittest
import transaction
from Persistence import Persistent
......@@ -75,7 +74,7 @@ class StorageTests(unittest.TestCase):
db.close()
def __checkDatabase(self, db_name):
db = MySQLdb.connect(db=db_name, user='test')
db = self.neo.getSQLConnection(db_name)
# wait for the sql transaction to be commited
def callback(last_try):
object_number = self.queryCount(db, 'select count(*) from obj')
......
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