Commit c457898e authored by Grégory Wisniewski's avatar Grégory Wisniewski

Split ZODB test in two to remove NEO speficic part from ZODB tests.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1779 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 7152f9aa
#
# 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()
...@@ -23,7 +23,8 @@ from persistent import Persistent ...@@ -23,7 +23,8 @@ from persistent import Persistent
from persistent.mapping import PersistentMapping from persistent.mapping import PersistentMapping
import transaction import transaction
from neo.tests.functional import NEOCluster, NEOFunctionalTest from neo.tests.zodb import ZODBTestCase
class P(Persistent): class P(Persistent):
pass pass
...@@ -38,18 +39,7 @@ class DecoyIndependent(Persistent): ...@@ -38,18 +39,7 @@ class DecoyIndependent(Persistent):
def _p_independent(self): def _p_independent(self):
return 0 return 0
class ZODBTests(NEOFunctionalTest): class ZODBTests(ZODBTestCase):
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 populate(self): def populate(self):
transaction.begin() transaction.begin()
...@@ -62,11 +52,6 @@ class ZODBTests(NEOFunctionalTest): ...@@ -62,11 +52,6 @@ class ZODBTests(NEOFunctionalTest):
transaction.commit() transaction.commit()
conn.close() conn.close()
def tearDown(self):
self._db.close()
self._storage.cleanup()
self.neo.stop()
def checkExportImport(self, abort_it=False): def checkExportImport(self, abort_it=False):
self.populate() self.populate()
conn = self._db.open() conn = self._db.open()
......
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