[Neo-report] r2723 jm - in /trunk/neo/tests: functional/ zodb/
nobody at svn.erp5.org
nobody at svn.erp5.org
Wed Apr 20 20:20:43 CEST 2011
Author: jm
Date: Wed Apr 20 20:20:43 2011
New Revision: 2723
Log:
tests: ignore NEO_TESTS_ADAPTER in tests requiring a SQL database
Although some tests of testStorage and testPack don't need a SQL database,
this patch applies to the whole class for simplicity's sake.
Modified:
trunk/neo/tests/functional/__init__.py
trunk/neo/tests/functional/testCluster.py
trunk/neo/tests/functional/testStorage.py
trunk/neo/tests/zodb/__init__.py
trunk/neo/tests/zodb/testPack.py
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] Wed Apr 20 20:20:43 2011
@@ -218,10 +218,12 @@ class NEOCluster(object):
db_user='neo', db_password='neo',
db_super_user=DB_ADMIN, db_super_password=DB_PASSWD,
cleanup_on_delete=False, temp_dir=None, clear_databases=True,
- adapter=os.getenv('NEO_TESTS_ADAPTER', 'MySQL'),
+ adapter=os.getenv('NEO_TESTS_ADAPTER'),
verbose=True,
address_type=ADDRESS_TYPE,
):
+ if not adapter:
+ adapter = 'MySQL'
self.zodb_storage_list = []
self.cleanup_on_delete = cleanup_on_delete
self.verbose = verbose
Modified: trunk/neo/tests/functional/testCluster.py
==============================================================================
--- trunk/neo/tests/functional/testCluster.py [iso-8859-1] (original)
+++ trunk/neo/tests/functional/testCluster.py [iso-8859-1] Wed Apr 20 20:20:43 2011
@@ -84,7 +84,7 @@ class ClusterTests(NEOFunctionalTest):
class PObject(Persistent):
pass
self.neo = NEOCluster(['test_neo1'], replicas=0,
- temp_dir=self.getTempDirectory())
+ temp_dir=self.getTempDirectory(), adapter='MySQL')
neoctl = self.neo.getNEOCTL()
self.neo.start()
db, conn = self.neo.getZODBConnection()
Modified: trunk/neo/tests/functional/testStorage.py
==============================================================================
--- trunk/neo/tests/functional/testStorage.py [iso-8859-1] (original)
+++ trunk/neo/tests/functional/testStorage.py [iso-8859-1] Wed Apr 20 20:20:43 2011
@@ -58,6 +58,7 @@ class StorageTests(NEOFunctionalTest):
partitions=partitions, replicas=replicas,
temp_dir=self.getTempDirectory(),
clear_databases=True,
+ adapter='MySQL',
)
# too many pending storage nodes requested
assert pending_number <= storage_number
Modified: trunk/neo/tests/zodb/__init__.py
==============================================================================
--- trunk/neo/tests/zodb/__init__.py [iso-8859-1] (original)
+++ trunk/neo/tests/zodb/__init__.py [iso-8859-1] Wed Apr 20 20:20:43 2011
@@ -23,7 +23,7 @@ import neo.lib
class ZODBTestCase(NEOFunctionalTest):
- def setUp(self):
+ def setUp(self, cluster_kw={}):
NEOFunctionalTest.setUp(self)
masters = int(os.environ.get('NEO_TEST_ZODB_MASTERS', 1))
storages = int(os.environ.get('NEO_TEST_ZODB_STORAGES', 1))
@@ -35,7 +35,7 @@ class ZODBTestCase(NEOFunctionalTest):
replicas=replicas,
master_node_count=masters,
temp_dir=self.getTempDirectory(),
- )
+ **cluster_kw)
self.neo.start()
self._storage = self.neo.getZODBStorage()
Modified: trunk/neo/tests/zodb/testPack.py
==============================================================================
--- trunk/neo/tests/zodb/testPack.py [iso-8859-1] (original)
+++ trunk/neo/tests/zodb/testPack.py [iso-8859-1] Wed Apr 20 20:20:43 2011
@@ -29,7 +29,9 @@ from neo.tests.zodb import ZODBTestCase
class PackableTests(ZODBTestCase, StorageTestBase,
PackableStorageWithOptionalGC, PackableUndoStorage):
- pass
+
+ def setUp(self):
+ super(PackableTests, self).setUp(cluster_kw={'adapter': 'MySQL'})
if __name__ == "__main__":
suite = unittest.makeSuite(PackableTests, 'check')
More information about the Neo-report
mailing list