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