[Zodb-checkins] SVN: ZODB/branches/jim-transform-wrapping/src/Z checkpoint
Jim Fulton
jim at zope.com
Fri May 14 17:48:45 EDT 2010
Log message for revision 112322:
checkpoint
Changed:
U ZODB/branches/jim-transform-wrapping/src/ZEO/tests/IterationTests.py
U ZODB/branches/jim-transform-wrapping/src/ZEO/tests/testZEO.py
U ZODB/branches/jim-transform-wrapping/src/ZODB/tests/hexstorage.py
U ZODB/branches/jim-transform-wrapping/src/ZODB/tests/testDemoStorage.py
U ZODB/branches/jim-transform-wrapping/src/ZODB/tests/testMappingStorage.py
-=-
Modified: ZODB/branches/jim-transform-wrapping/src/ZEO/tests/IterationTests.py
===================================================================
--- ZODB/branches/jim-transform-wrapping/src/ZEO/tests/IterationTests.py 2010-05-14 21:02:00 UTC (rev 112321)
+++ ZODB/branches/jim-transform-wrapping/src/ZEO/tests/IterationTests.py 2010-05-14 21:48:44 UTC (rev 112322)
@@ -47,13 +47,14 @@
def checkIteratorGCSpanTransactions(self):
# Keep a hard reference to the iterator so it won't be automatically
# garbage collected at the transaction boundary.
+ self._dostore()
iterator = self._storage.iterator()
self._dostore()
# As the iterator was not garbage collected, we can still use it. (We
# don't see the transaction we just wrote being picked up, because
# iterators only see the state from the point in time when they were
# created.)
- self.assertEquals([], list(iterator))
+ self.assert_(list(iterator))
def checkIteratorGCStorageCommitting(self):
# We want the iterator to be garbage-collected, so we don't keep any
Modified: ZODB/branches/jim-transform-wrapping/src/ZEO/tests/testZEO.py
===================================================================
--- ZODB/branches/jim-transform-wrapping/src/ZEO/tests/testZEO.py 2010-05-14 21:02:00 UTC (rev 112321)
+++ ZODB/branches/jim-transform-wrapping/src/ZEO/tests/testZEO.py 2010-05-14 21:48:44 UTC (rev 112322)
@@ -317,6 +317,16 @@
</filestorage>
"""
+ _expected_interfaces = (
+ ('ZODB.interfaces', 'IStorageRestoreable'),
+ ('ZODB.interfaces', 'IStorageIteration'),
+ ('ZODB.interfaces', 'IStorageUndoable'),
+ ('ZODB.interfaces', 'IStorageCurrentRecordIteration'),
+ ('ZODB.interfaces', 'IExternalGC'),
+ ('ZODB.interfaces', 'IStorage'),
+ ('zope.interface', 'Interface'),
+ )
+
def checkInterfaceFromRemoteStorage(self):
# ClientStorage itself doesn't implement IStorageIteration, but the
# FileStorage on the other end does, and thus the ClientStorage
@@ -326,19 +336,33 @@
self.failUnless(ZODB.interfaces.IStorageIteration.providedBy(
self._storage))
# This is communicated using ClientStorage's _info object:
- self.assertEquals(
- (('ZODB.interfaces', 'IStorageRestoreable'),
- ('ZODB.interfaces', 'IStorageIteration'),
- ('ZODB.interfaces', 'IStorageUndoable'),
- ('ZODB.interfaces', 'IStorageCurrentRecordIteration'),
- ('ZODB.interfaces', 'IExternalGC'),
- ('ZODB.interfaces', 'IStorage'),
- ('zope.interface', 'Interface'),
- ),
+ self.assertEquals(self._expected_interfaces,
self._storage._info['interfaces']
)
+class FileStorageHexTests(FileStorageTests):
+ _expected_interfaces = (
+ ('ZODB.interfaces', 'IStorageRestoreable'),
+ ('ZODB.interfaces', 'IStorageIteration'),
+ ('ZODB.interfaces', 'IStorageUndoable'),
+ ('ZODB.interfaces', 'IStorageCurrentRecordIteration'),
+ ('ZODB.interfaces', 'IExternalGC'),
+ ('ZODB.interfaces', 'IStorage'),
+ ('ZODB.interfaces', 'IStorageWrapper'),
+ ('zope.interface', 'Interface'),
+ )
+ def getConfig(self):
+ return """\
+ %import ZODB.tests
+ <hexstorage>
+ <filestorage 1>
+ path Data.fs
+ </filestorage>
+ </hexstorage>
+ """
+
+
class MappingStorageTests(GenericTests):
"""ZEO backed by a Mapping storage."""
@@ -1405,7 +1429,8 @@
slow_test_classes = [
BlobAdaptedFileStorageTests, BlobWritableCacheTests,
- DemoStorageTests, FileStorageTests, MappingStorageTests,
+ DemoStorageTests, FileStorageTests, FileStorageHexTests,
+ MappingStorageTests,
]
quick_test_classes = [
Modified: ZODB/branches/jim-transform-wrapping/src/ZODB/tests/hexstorage.py
===================================================================
--- ZODB/branches/jim-transform-wrapping/src/ZODB/tests/hexstorage.py 2010-05-14 21:02:00 UTC (rev 112321)
+++ ZODB/branches/jim-transform-wrapping/src/ZODB/tests/hexstorage.py 2010-05-14 21:48:44 UTC (rev 112322)
@@ -158,7 +158,4 @@
def open(self):
base = self.config.base.open()
- compress = self.config.compress
- if compress is None:
- compress = True
- return Storage(base, compress)
+ return HexStorage(base)
Modified: ZODB/branches/jim-transform-wrapping/src/ZODB/tests/testDemoStorage.py
===================================================================
--- ZODB/branches/jim-transform-wrapping/src/ZODB/tests/testDemoStorage.py 2010-05-14 21:02:00 UTC (rev 112321)
+++ ZODB/branches/jim-transform-wrapping/src/ZODB/tests/testDemoStorage.py 2010-05-14 21:48:44 UTC (rev 112322)
@@ -16,6 +16,7 @@
import transaction
from ZODB.DB import DB
from zope.testing import doctest
+import ZODB.tests.hexstorage
import ZODB.tests.util
import ZODB.utils
import ZODB.DemoStorage
@@ -78,6 +79,13 @@
checkUndoZombie = checkLoadBeforeUndo
+class DemoStorageHexTests(DemoStorageTests):
+
+ def setUp(self):
+ StorageTestBase.StorageTestBase.setUp(self)
+ self._storage = ZODB.tests.hexstorage.HexStorage(
+ ZODB.DemoStorage.DemoStorage())
+
class DemoStorageWrappedBase(DemoStorageTests):
def setUp(self):
@@ -111,8 +119,13 @@
from ZODB.FileStorage import FileStorage
return FileStorage('FileStorageTests.fs')
+class DemoStorageWrappedAroundHexMappingStorage(DemoStorageWrappedBase):
+ def _makeBaseStorage(self):
+ from ZODB.MappingStorage import MappingStorage
+ return ZODB.tests.hexstorage.HexStorage(MappingStorage())
+
def setUp(test):
random.seed(0)
ZODB.tests.util.setUp(test)
@@ -232,8 +245,11 @@
),
))
suite.addTest(unittest.makeSuite(DemoStorageTests, 'check'))
+ suite.addTest(unittest.makeSuite(DemoStorageHexTests, 'check'))
suite.addTest(unittest.makeSuite(DemoStorageWrappedAroundFileStorage,
'check'))
suite.addTest(unittest.makeSuite(DemoStorageWrappedAroundMappingStorage,
'check'))
+ suite.addTest(unittest.makeSuite(DemoStorageWrappedAroundHexMappingStorage,
+ 'check'))
return suite
Modified: ZODB/branches/jim-transform-wrapping/src/ZODB/tests/testMappingStorage.py
===================================================================
--- ZODB/branches/jim-transform-wrapping/src/ZODB/tests/testMappingStorage.py 2010-05-14 21:02:00 UTC (rev 112321)
+++ ZODB/branches/jim-transform-wrapping/src/ZODB/tests/testMappingStorage.py 2010-05-14 21:48:44 UTC (rev 112322)
@@ -13,6 +13,7 @@
##############################################################################
import ZODB.MappingStorage
import unittest
+import ZODB.tests.hexstorage
from ZODB.tests import (
@@ -48,13 +49,21 @@
# doesnt support huge transaction metadata. This storage doesnt
# have this limit, so we inhibit this test here.
pass
-
+
def checkLoadBeforeUndo(self):
pass # we don't support undo yet
checkUndoZombie = checkLoadBeforeUndo
+class MappingStorageHexTests(MappingStorageTests):
+
+ def setUp(self):
+ StorageTestBase.StorageTestBase.setUp(self, )
+ self._storage = ZODB.tests.hexstorage.HexStorage(
+ ZODB.MappingStorage.MappingStorage())
+
def test_suite():
suite = unittest.makeSuite(MappingStorageTests, 'check')
+ suite = unittest.makeSuite(MappingStorageHexTests, 'check')
return suite
if __name__ == "__main__":
More information about the Zodb-checkins
mailing list