[Zodb-checkins] CVS: StandaloneZODB/ZODB/tests - StorageTestBase.py:1.13

Jeremy Hylton jeremy@zope.com
Wed, 23 Jan 2002 16:18:55 -0500


Update of /cvs-repository/StandaloneZODB/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv24819/ZODB/tests

Modified Files:
	StorageTestBase.py 
Log Message:
Add optional user and description arguments to _dostore().

If supplied, they are stored as metadata on the transaction object.
This is helpful for debugging.


=== StandaloneZODB/ZODB/tests/StorageTestBase.py 1.12 => 1.13 ===
 
     def _dostore(self, oid=None, revid=None, data=None, version=None,
-                 already_pickled=0):
+                 already_pickled=0, user=None, description=None):
         """Do a complete storage transaction.  The defaults are:
         
          - oid=None, ask the storage for a new oid
@@ -148,6 +148,10 @@
             version = ''
         # Begin the transaction
         t = Transaction()
+        if user is not None:
+            t.user = user
+        if description is not None:
+            t.description = description
         self._storage.tpc_begin(t)
         # Store an object
         r1 = self._storage.store(oid, revid, data, version, t)
@@ -156,5 +160,6 @@
         self._storage.tpc_finish(t)
         return handle_serials(oid, r1, r2)
         
-    def _dostoreNP(self, oid=None, revid=None, data=None, version=None):
+    def _dostoreNP(self, oid=None, revid=None, data=None, version=None,
+                   user=None, description=None):
         return self._dostore(oid, revid, data, version, already_pickled=1)