[Neo-report] r1779 gregory - in /trunk/neo/tests/zodb: __init__.py testZODB.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Feb 16 17:41:55 CET 2010
Author: gregory
Date: Tue Feb 16 17:41:55 2010
New Revision: 1779
Log:
Split ZODB test in two to remove NEO speficic part from ZODB tests.
Added:
trunk/neo/tests/zodb/__init__.py
Modified:
trunk/neo/tests/zodb/testZODB.py
Added: trunk/neo/tests/zodb/__init__.py
==============================================================================
--- trunk/neo/tests/zodb/__init__.py (added)
+++ trunk/neo/tests/zodb/__init__.py [iso-8859-1] Tue Feb 16 17:41:55 2010
@@ -1,0 +1,40 @@
+#
+# Copyright (C) 2009-2010 Nexedi SA
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+import unittest
+import ZODB
+
+from neo.tests.functional import NEOCluster, NEOFunctionalTest
+
+class ZODBTestCase(NEOFunctionalTest):
+
+ def setUp(self):
+ NEOFunctionalTest.setUp(self)
+ self.neo = NEOCluster(['test_neo1'],
+ partitions=1, replicas=0, port_base=20000,
+ master_node_count=1, temp_dir=self.getTempDirectory())
+ self.neo.stop()
+ self.neo.setupDB()
+ self.neo.start()
+ self._storage = self.neo.getZODBStorage()
+ self._db = ZODB.DB(self._storage)
+
+ def tearDown(self):
+ self._db.close()
+ self._storage.cleanup()
+ self.neo.stop()
+
Modified: trunk/neo/tests/zodb/testZODB.py
==============================================================================
--- trunk/neo/tests/zodb/testZODB.py [iso-8859-1] (original)
+++ trunk/neo/tests/zodb/testZODB.py [iso-8859-1] Tue Feb 16 17:41:55 2010
@@ -23,7 +23,8 @@
from persistent.mapping import PersistentMapping
import transaction
-from neo.tests.functional import NEOCluster, NEOFunctionalTest
+from neo.tests.zodb import ZODBTestCase
+
class P(Persistent):
pass
@@ -38,18 +39,7 @@
def _p_independent(self):
return 0
-class ZODBTests(NEOFunctionalTest):
-
- def setUp(self):
- NEOFunctionalTest.setUp(self)
- self.neo = NEOCluster(['test_neo1'],
- partitions=1, replicas=0, port_base=20000,
- master_node_count=1, temp_dir=self.getTempDirectory())
- self.neo.stop()
- self.neo.setupDB()
- self.neo.start()
- self._storage = self.neo.getZODBStorage()
- self._db = ZODB.DB(self._storage)
+class ZODBTests(ZODBTestCase):
def populate(self):
transaction.begin()
@@ -61,11 +51,6 @@
transaction.get().note('created test data')
transaction.commit()
conn.close()
-
- def tearDown(self):
- self._db.close()
- self._storage.cleanup()
- self.neo.stop()
def checkExportImport(self, abort_it=False):
self.populate()
More information about the Neo-report
mailing list