[Zodb-checkins] CVS: Zope2/lib/python/ZODB - StorageTestBase.py:1.2

barry@digicool.com barry@digicool.com
Thu, 19 Apr 2001 16:47:37 -0400 (EDT)


Update of /cvs-repository/Zope2/lib/python/ZODB/tests
In directory korak:/tmp/cvs-serv30154

Modified Files:
	StorageTestBase.py 
Log Message:
_dostore(): Add argument flag `already_pickled' which if true,
suppresses the pickling of the data.

_dostoreNP(): A shortcut for _dostore(..., already_pickled=1)



--- Updated File StorageTestBase.py in package Zope2/lib/python/ZODB --
--- StorageTestBase.py	2001/04/11 22:03:57	1.1
+++ StorageTestBase.py	2001/04/19 20:47:36	1.2
@@ -25,7 +25,8 @@
     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 @@
         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 @@
         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)