Commit ce541038 authored by Jeremy Hylton's avatar Jeremy Hylton

Add getSerial() method to ZEO to pass new test.

Disable test for ZEO + MappingStorage, since it doesn't support undo.
parent 53632750
......@@ -625,6 +625,10 @@ class ClientStorage:
"""
return self._server.history(oid, version, length)
def getSerial(self, oid):
"""Storage API: return current serial number for oid."""
return self._server.getSerial(oid)
def loadSerial(self, oid, serial):
"""Storage API: load a historical revision of an object."""
return self._server.loadSerial(oid, serial)
......
......@@ -104,6 +104,9 @@ class StorageServer:
def load(self, oid, version):
return self.rpc.call('load', oid, version)
def getSerial(self, oid):
return self.rpc.call('getSerial', oid)
def loadSerial(self, oid, serial):
return self.rpc.call('loadSerial', oid, serial)
......
......@@ -119,6 +119,7 @@ class ZEOStorage:
"""Delegate several methods to the storage"""
self.versionEmpty = self.storage.versionEmpty
self.versions = self.storage.versions
self.getSerial = self.storage.getSerial
self.history = self.storage.history
self.load = self.storage.load
self.loadSerial = self.storage.loadSerial
......
......@@ -239,6 +239,7 @@ class MappingStorageTests(FileStorageTests):
def checkCommitLockUndoClose(self): pass
def checkCommitLockUndoAbort(self): pass
def checkCommitEmptyVersionInvalidation(self): pass
def checkCreationUndoneGetSerial(self): pass
def checkAbortVersionSerialno(self): pass
def checkAbortVersionInvalidation(self): pass
def checkAbortVersionErrors(self): pass
......@@ -262,10 +263,10 @@ def test_suite():
suite = unittest.TestSuite()
for klass in test_classes:
sub = unittest.makeSuite(klass, 'check')
sub = unittest.makeSuite(klass, "check")
suite.addTest(sub)
return suite
if __name__ == "__main__":
unittest.main(defaultTest='test_suite')
unittest.main(defaultTest="test_suite")
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