Commit c5bf9abd authored by Jeremy Hylton's avatar Jeremy Hylton

doc strings

parent e485bfad
# Run the history() related tests for a storage. Any storage that supports """Run the history() related tests for a storage.
# the history() method should be able to pass all these tests.
Any storage that supports the history() method should be able to pass
all these tests.
"""
from ZODB.tests.MinPO import MinPO from ZODB.tests.MinPO import MinPO
from ZODB.tests.StorageTestBase import zodb_unpickle from ZODB.tests.StorageTestBase import zodb_unpickle
......
# Run tests against the iterator() interface for storages. Any storage that """Run tests against the iterator() interface for storages.
# supports the iterator() method should be able to pass all these tests.
Any storage that supports the iterator() method should be able to pass
all these tests.
"""
from ZODB.tests.MinPO import MinPO from ZODB.tests.MinPO import MinPO
from ZODB.tests.StorageTestBase import zodb_unpickle from ZODB.tests.StorageTestBase import zodb_unpickle
......
# Run some tests relevant for storages that support pack() """Run some tests relevant for storages that support pack()."""
try: try:
import cPickle import cPickle
...@@ -18,7 +18,6 @@ from ZODB.referencesf import referencesf ...@@ -18,7 +18,6 @@ from ZODB.referencesf import referencesf
ZERO = '\0'*8 ZERO = '\0'*8
# This class is for the root object. It must not contain a getoid() method # This class is for the root object. It must not contain a getoid() method
# (really, attribute). The persistent pickling machinery -- in the dumps() # (really, attribute). The persistent pickling machinery -- in the dumps()
......
# This class must be one of the mixin base class for your storage test. It """Provide a mixin base class for storage tests.
# provides basic setUp() and tearDown() semantics (which you can override),
# and it also provides a helper method _dostore() which performs a complete The StorageTestBase class provides basic setUp() and tearDown()
# store transaction for a single object revision. semantics (which you can override), and it also provides a helper
method _dostore() which performs a complete store transaction for a
single object revision.
"""
import pickle import pickle
import string import string
...@@ -18,6 +21,7 @@ from ZODB.tests.MinPO import MinPO ...@@ -18,6 +21,7 @@ from ZODB.tests.MinPO import MinPO
ZERO = '\0'*8 ZERO = '\0'*8
def zodb_pickle(obj): def zodb_pickle(obj):
"""Create a pickle in the format expected by ZODB."""
f = StringIO() f = StringIO()
p = Pickler(f, 1) p = Pickler(f, 1)
klass = obj.__class__ klass = obj.__class__
...@@ -35,6 +39,7 @@ def zodb_pickle(obj): ...@@ -35,6 +39,7 @@ def zodb_pickle(obj):
return f.getvalue(1) return f.getvalue(1)
def zodb_unpickle(data): def zodb_unpickle(data):
"""Unpickle an object stored using the format expected by ZODB."""
f = StringIO(data) f = StringIO(data)
u = Unpickler(f) u = Unpickler(f)
klass_info = u.load() klass_info = u.load()
......
# Check transactionalUndo(). Any storage that supports transactionalUndo() """Check transactionalUndo().
# must pass these tests.
Any storage that supports transactionalUndo() must pass these tests.
"""
import types import types
from ZODB import POSException from ZODB import POSException
......
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