[Zope-CVS] CVS: Products/Ape/lib/apelib/tests - testall.py:1.4 testzope2fs.py:1.4 testzope2sql.py:1.6
Shane Hathaway
shane@zope.com
Wed, 9 Jul 2003 11:40:44 -0400
Update of /cvs-repository/Products/Ape/lib/apelib/tests
In directory cvs.zope.org:/tmp/cvs-serv4933/lib/apelib/tests
Modified Files:
testall.py testzope2fs.py testzope2sql.py
Log Message:
Merged ape-newconf-branch. Mappers are now configured using XML.
=== Products/Ape/lib/apelib/tests/testall.py 1.3 => 1.4 ===
--- Products/Ape/lib/apelib/tests/testall.py:1.3 Mon May 26 15:33:16 2003
+++ Products/Ape/lib/apelib/tests/testall.py Wed Jul 9 11:40:08 2003
@@ -37,6 +37,7 @@
from testzope2fs import Zope2FSTests, Zope2FSUnderscoreTests
from testparams import ParamsTests
from testsqlimpl import ApelibSQLImplTests
+from apelib.config.tests.test_minitables import MiniTableTests
import testzope2sql
sql_suite = testzope2sql.test_suite()
@@ -45,6 +46,7 @@
suite = unittest.TestSuite()
for klass in (
SerializationTests,
+ MiniTableTests,
ApelibImplTests,
ApeStorageTests,
ApeIOTests,
=== Products/Ape/lib/apelib/tests/testzope2fs.py 1.3 => 1.4 ===
--- Products/Ape/lib/apelib/tests/testzope2fs.py:1.3 Sun May 18 00:16:30 2003
+++ Products/Ape/lib/apelib/tests/testzope2fs.py Wed Jul 9 11:40:08 2003
@@ -31,8 +31,9 @@
from apelib.zodb3.db import ApeDB
from apelib.zodb3.storage import ApeStorage
from apelib.zodb3.resource import StaticResource
-from apelib.zope2.fsmapper import createMapper
+from apelib.zope2.mapper import createMapper
from apelib.fs.exceptions import FSWriteError
+from apelib.fs.connection import FSConnection
from zope2testbase import Zope2TestBase, Folder
@@ -43,17 +44,21 @@
tmpdir = mktemp()
+root_mapper = createMapper('filesystem')
+
class Zope2FSTests (unittest.TestCase, Zope2TestBase):
- def _createMapper(self, path):
- return createMapper(path)
+ def _createConnections(self, path):
+ conn = FSConnection(path)
+ return {'fs': conn}
def setUp(self):
if not os.path.exists(tmpdir):
os.mkdir(tmpdir)
self.path = tmpdir
- self.root_mapper, conns = self._createMapper(tmpdir)
+ self.root_mapper = root_mapper
+ conns = self._createConnections(tmpdir)
assert len(conns) == 1
self.conn = conns['fs']
resource = StaticResource(self.root_mapper)
@@ -92,7 +97,7 @@
keychain = conn.db()._oid_encoder.decode(folder._p_oid)
key = keychain[-1]
text = self.conn.readSection(key, 'classification')
- self.assert_(text.find('meta_type=Folder') >= 0)
+ self.assert_(text.find('class_name=OFS.Folder.Folder') >= 0)
finally:
conn.close()
@@ -597,8 +602,9 @@
class Zope2FSUnderscoreTests (Zope2FSTests):
- def _createMapper(self, path):
- return createMapper(path, metadata_prefix='_')
+ def _createConnections(self, path):
+ conn = FSConnection(path, metadata_prefix='_')
+ return {'fs': conn}
if __name__ == '__main__':
=== Products/Ape/lib/apelib/tests/testzope2sql.py 1.5 => 1.6 ===
--- Products/Ape/lib/apelib/tests/testzope2sql.py:1.5 Mon May 19 15:32:35 2003
+++ Products/Ape/lib/apelib/tests/testzope2sql.py Wed Jul 9 11:40:08 2003
@@ -23,10 +23,12 @@
from apelib.zodb3.db import ApeDB
from apelib.zodb3.storage import ApeStorage
from apelib.zodb3.resource import StaticResource
-from apelib.zope2.sqlmapper import createAbstractMapper
+from apelib.zope2.mapper import createMapper
from zope2testbase import Zope2TestBase
+root_mapper = createMapper('sql')
+
class Zope2SQLTests (Zope2TestBase):
dbapi_module = None # Name of the Database API module (required)
@@ -39,7 +41,7 @@
def setUp(self):
conn = self.getConnector()
- self.root_mapper = createAbstractMapper()
+ self.root_mapper = root_mapper
resource = StaticResource(self.root_mapper)
self.conns = {'db': conn}
storage = ApeStorage(resource, self.conns, clear_all=1)