Commit 993fccdc authored by Barry Warsaw's avatar Barry Warsaw

_dostore(): Add argument flag `already_pickled' which if true,

suppresses the pickling of the data.

_dostoreNP(): A shortcut for _dostore(..., already_pickled=1)
parent 53a843bb
......@@ -25,7 +25,8 @@ class StorageTestBase(unittest.TestCase):
def tearDown(self):
self._close()
def _dostore(self, oid=None, revid=None, data=None, version=None):
def _dostore(self, oid=None, revid=None, data=None, version=None,
already_pickled=0):
# Do a complete storage transaction. The defaults are:
# - oid=None, ask the storage for a new oid
# - revid=None, use a revid of ZERO
......@@ -38,8 +39,8 @@ class StorageTestBase(unittest.TestCase):
if revid is None:
revid = ZERO
if data is None:
data = pickle.dumps(7)
else:
data = 7
if not already_pickled:
data = pickle.dumps(data)
if version is None:
version = ''
......@@ -53,3 +54,5 @@ class StorageTestBase(unittest.TestCase):
self._storage.tpc_finish(self._transaction)
return newrevid
def _dostoreNP(self, oid=None, revid=None, data=None, version=None):
self._dostore(oid, revid, data, version, already_pickled=1)
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