Commit 0017bbdc authored by Jeremy Hylton's avatar Jeremy Hylton

Add new tests from ZEO2.

XXX The two cache invalidation tests fails currently.
parent 2224b1aa
...@@ -9,16 +9,18 @@ import unittest ...@@ -9,16 +9,18 @@ import unittest
import ZEO.ClientStorage, ZEO.StorageServer import ZEO.ClientStorage, ZEO.StorageServer
import ThreadedAsync, ZEO.trigger import ThreadedAsync, ZEO.trigger
from ZODB.FileStorage import FileStorage
from ZEO.tests import forker from ZEO.tests import forker, Cache
# Sorry Jim... # Sorry Jim...
from ZODB.tests import StorageTestBase, BasicStorage, VersionStorage, \ from ZODB.tests import StorageTestBase, BasicStorage, VersionStorage, \
TransactionalUndoStorage, TransactionalUndoVersionStorage, \ TransactionalUndoStorage, TransactionalUndoVersionStorage, \
PackableStorage, Synchronization PackableStorage, Synchronization, ConflictResolution
from ZODB.tests.MinPO import MinPO
ZERO = '\0'*8 ZERO = '\0'*8
import pickle
class DummyDB: class DummyDB:
def invalidate(self, *args): def invalidate(self, *args):
...@@ -59,9 +61,9 @@ class ZEOTestBase(StorageTestBase.StorageTestBase): ...@@ -59,9 +61,9 @@ class ZEOTestBase(StorageTestBase.StorageTestBase):
if revid is None: if revid is None:
revid = ZERO revid = ZERO
if data is None: if data is None:
data = 7 data = MinPO(7)
if not already_pickled: if not already_pickled:
data = pickle.dumps(data) data = StorageTestBase.zodb_pickle(data)
if version is None: if version is None:
version = '' version = ''
# Begin the transaction # Begin the transaction
...@@ -92,11 +94,17 @@ class ZEOTestBase(StorageTestBase.StorageTestBase): ...@@ -92,11 +94,17 @@ class ZEOTestBase(StorageTestBase.StorageTestBase):
d[oid] = serial d[oid] = serial
return d return d
def checkLargeUpdate(self):
obj = MinPO("X" * (10 * 128 * 1024))
self._dostore(data=obj)
class GenericTests(ZEOTestBase, class GenericTests(ZEOTestBase,
Cache.StorageWithCache,
BasicStorage.BasicStorage, BasicStorage.BasicStorage,
VersionStorage.VersionStorage, VersionStorage.VersionStorage,
PackableStorage.PackableStorage, PackableStorage.PackableStorage,
Synchronization.SynchronizedStorage, Synchronization.SynchronizedStorage,
ConflictResolution.ConflictResolvingStorage,
): ):
"""An abstract base class for ZEO tests """An abstract base class for ZEO tests
...@@ -133,14 +141,12 @@ class GenericTests(ZEOTestBase, ...@@ -133,14 +141,12 @@ class GenericTests(ZEOTestBase,
class ZEOFileStorageTests(GenericTests): class ZEOFileStorageTests(GenericTests):
__super_setUp = GenericTests.setUp __super_setUp = GenericTests.setUp
from ZODB.FileStorage import FileStorage
def setUp(self): def setUp(self):
self.__fs_base = tempfile.mktemp() self.__fs_base = tempfile.mktemp()
self.__super_setUp() self.__super_setUp()
def getStorage(self): def getStorage(self):
return self.FileStorage(self.__fs_base, create=1) return FileStorage(self.__fs_base, create=1)
def delStorage(self): def delStorage(self):
# file storage appears to create three files # file storage appears to create three files
......
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