[Zope-CVS] CVS: Products/Ape/lib/apelib/tests - testzope2sql.py:1.12.2.1

Shane Hathaway shane at zope.com
Wed Jul 21 00:55:48 EDT 2004


Update of /cvs-repository/Products/Ape/lib/apelib/tests
In directory cvs.zope.org:/tmp/cvs-serv5818/tests

Modified Files:
      Tag: sql-types-branch
	testzope2sql.py 
Log Message:
Another checkpoint:

- Implemented AbstractSQLConnection.define_table(), which now 
coordinates translation to specific databases.

- Moved MySQL and PostgreSQL classes to their own modules.

- Laid a foundation for prepared queries.

- Fixed bugs in the new code.


=== Products/Ape/lib/apelib/tests/testzope2sql.py 1.12 => 1.12.2.1 ===
--- Products/Ape/lib/apelib/tests/testzope2sql.py:1.12	Wed Mar 24 23:28:23 2004
+++ Products/Ape/lib/apelib/tests/testzope2sql.py	Wed Jul 21 00:55:47 2004
@@ -19,7 +19,6 @@
 import unittest
 import sys
 
-import apelib.sql.dbapi
 from apelib.zodb3.db import ApeDB
 from apelib.zodb3.storage import ApeStorage
 from apelib.zodb3.resource import StaticResource
@@ -36,7 +35,10 @@
     connect_expression = ''
 
     def get_connection(self):
-        c = getattr(apelib.sql.dbapi, self.class_name)
+        pos = self.class_name.rfind('.')
+        m = self.class_name[:pos]
+        cn = self.class_name[pos + 1:]
+        c = getattr(__import__(m, {}, {}, ('__doc__',)), cn)
         return c(self.dbapi_module, self.connect_expression, prefix="apetest_")
 
     def setUp(self):
@@ -79,13 +81,13 @@
 
 class PsycopgTests (Zope2SQLTests, unittest.TestCase):
     dbapi_module = 'psycopg'
-    class_name = 'PostgreSQLConnection'
+    class_name = 'apelib.sql.postgresql.PostgreSQLConnection'
     connect_expression = 'connect("")'
 
 
 class MySQLTests (Zope2SQLTests, unittest.TestCase):
     dbapi_module = 'MySQLdb'
-    class_name = 'MySQLConnection'
+    class_name = 'apelib.sql.mysql.MySQLConnection'
     connect_expression = 'connect(db="ape")'
 
 



More information about the Zope-CVS mailing list