[Zope3-checkins] CVS: Zope3/src/ZODB/tests -
testTransaction.py:1.19.2.7 testFileStorage.py:1.38.2.1
VersionStorage.py:1.30.8.1
TransactionalUndoVersionStorage.py:1.18.2.1
TransactionalUndoStorage.py:1.40.2.1
Synchronization.py:1.10.8.1 StorageTestBase.py:1.33.8.1
RevisionStorage.py:1.6.10.1 RecoveryStorage.py:1.12.8.1
ReadOnlyStorage.py:1.10.8.1 PackableStorage.py:1.37.2.1
MTStorage.py:1.15.2.2 IteratorStorage.py:1.19.8.1
HistoryStorage.py:1.14.2.1 ConflictResolution.py:1.15.2.1
BasicStorage.py:1.28.10.1
Jeremy Hylton
jeremy at zope.com
Tue Mar 30 15:19:09 EST 2004
Update of /cvs-repository/Zope3/src/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv22154/src/ZODB/tests
Modified Files:
Tag: jeremy-txn-branch
testTransaction.py testFileStorage.py VersionStorage.py
TransactionalUndoVersionStorage.py TransactionalUndoStorage.py
Synchronization.py StorageTestBase.py RevisionStorage.py
RecoveryStorage.py ReadOnlyStorage.py PackableStorage.py
MTStorage.py IteratorStorage.py HistoryStorage.py
ConflictResolution.py BasicStorage.py
Log Message:
Change tests to use transaction instead of ZODB.Transaction.
=== Zope3/src/ZODB/tests/testTransaction.py 1.19.2.6 => 1.19.2.7 ===
--- Zope3/src/ZODB/tests/testTransaction.py:1.19.2.6 Fri Mar 19 17:31:25 2004
+++ Zope3/src/ZODB/tests/testTransaction.py Tue Mar 30 15:19:01 2004
@@ -633,17 +633,17 @@
transaction.interfaces.IDataManager.
>>> from ZODB.tests.sampledm import DataManager
- >>> from ZODB.Transaction import DataManagerAdapter
- >>> t = Transaction.Transaction()
+ >>> from transaction._transaction import DataManagerAdapter
+ >>> t = transaction.Transaction()
>>> dm = DataManager()
>>> t.join(dm)
The end result is that a data manager adapter is one of the
transaction's objects:
- >>> isinstance(t._objects[0], DataManagerAdapter)
+ >>> isinstance(t._resources[0], DataManagerAdapter)
True
- >>> t._objects[0]._datamanager is dm
+ >>> t._resources[0]._datamanager is dm
True
"""
=== Zope3/src/ZODB/tests/testFileStorage.py 1.38 => 1.38.2.1 ===
--- Zope3/src/ZODB/tests/testFileStorage.py:1.38 Thu Feb 26 19:31:55 2004
+++ Zope3/src/ZODB/tests/testFileStorage.py Tue Mar 30 15:19:01 2004
@@ -11,9 +11,9 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-import ZODB.FileStorage
import os, unittest
-from ZODB.Transaction import Transaction
+import transaction
+import ZODB.FileStorage
from ZODB import POSException
from ZODB.tests import StorageTestBase, BasicStorage, \
@@ -195,7 +195,7 @@
# every 8000 calls. Make sure it gets minimal coverage.
oids = [[self._storage.new_oid(), None] for i in range(100)]
for i in range(100):
- t = Transaction()
+ t = transaction.Transaction()
self._storage.tpc_begin(t)
for j in range(100):
o = MinPO(j)
=== Zope3/src/ZODB/tests/VersionStorage.py 1.30 => 1.30.8.1 ===
--- Zope3/src/ZODB/tests/VersionStorage.py:1.30 Thu Feb 19 13:35:23 2004
+++ Zope3/src/ZODB/tests/VersionStorage.py Tue Mar 30 15:19:01 2004
@@ -18,9 +18,10 @@
import time
+from transaction import Transaction
+
from ZODB import POSException
from ZODB.serialize import referencesf
-from ZODB.Transaction import Transaction
from ZODB.tests.MinPO import MinPO
from ZODB.tests.StorageTestBase import zodb_unpickle, snooze
from ZODB import DB
=== Zope3/src/ZODB/tests/TransactionalUndoVersionStorage.py 1.18 => 1.18.2.1 ===
--- Zope3/src/ZODB/tests/TransactionalUndoVersionStorage.py:1.18 Thu Feb 26 19:31:55 2004
+++ Zope3/src/ZODB/tests/TransactionalUndoVersionStorage.py Tue Mar 30 15:19:01 2004
@@ -16,8 +16,9 @@
import time
+import transaction
+
from ZODB.serialize import referencesf
-from ZODB.Transaction import Transaction
from ZODB.tests.MinPO import MinPO
from ZODB.tests.StorageTestBase import zodb_unpickle
@@ -114,7 +115,7 @@
version=version, description='version2')
self._x_dostore(description='create2')
- t = Transaction()
+ t = transaction.Transaction()
t.description = 'commit version'
self._storage.tpc_begin(t)
self._storage.commitVersion(version, '', t)
=== Zope3/src/ZODB/tests/TransactionalUndoStorage.py 1.40 => 1.40.2.1 ===
--- Zope3/src/ZODB/tests/TransactionalUndoStorage.py:1.40 Thu Feb 26 19:31:55 2004
+++ Zope3/src/ZODB/tests/TransactionalUndoStorage.py Tue Mar 30 15:19:02 2004
@@ -18,13 +18,15 @@
import time
import types
+
+from persistent import Persistent
+from transaction import Transaction
+
from ZODB import POSException
-from ZODB.Transaction import Transaction
from ZODB.serialize import referencesf
from ZODB.utils import p64
from ZODB import DB
-from persistent import Persistent
from ZODB.tests.MinPO import MinPO
from ZODB.tests.StorageTestBase import zodb_pickle, zodb_unpickle
=== Zope3/src/ZODB/tests/Synchronization.py 1.10 => 1.10.8.1 ===
--- Zope3/src/ZODB/tests/Synchronization.py:1.10 Tue Feb 17 20:12:59 2004
+++ Zope3/src/ZODB/tests/Synchronization.py Tue Mar 30 15:19:02 2004
@@ -62,7 +62,7 @@
"""
-from ZODB.Transaction import Transaction
+from transaction import Transaction
from ZODB.POSException import StorageTransactionError
VERSION = "testversion"
=== Zope3/src/ZODB/tests/StorageTestBase.py 1.33 => 1.33.8.1 ===
--- Zope3/src/ZODB/tests/StorageTestBase.py:1.33 Wed Feb 18 21:59:10 2004
+++ Zope3/src/ZODB/tests/StorageTestBase.py Tue Mar 30 15:19:02 2004
@@ -26,9 +26,9 @@
from cPickle import Pickler, Unpickler
from cStringIO import StringIO
-from ZODB.Transaction import Transaction
-from ZODB.utils import u64
+import transaction
+from ZODB.utils import u64
from ZODB.tests.MinPO import MinPO
ZERO = '\0'*8
@@ -184,7 +184,7 @@
if version is None:
version = ''
# Begin the transaction
- t = Transaction()
+ t = transaction.Transaction()
if user is not None:
t.user = user
if description is not None:
@@ -211,7 +211,7 @@
def _undo(self, tid, expected_oids=None, note=None):
# Undo a tid that affects a single object (oid).
# XXX This is very specialized
- t = Transaction()
+ t = transaction.Transaction()
t.note(note or "undo")
self._storage.tpc_begin(t)
tid, oids = self._storage.undo(tid, t)
@@ -224,7 +224,7 @@
return self._storage.lastTransaction()
def _commitVersion(self, src, dst):
- t = Transaction()
+ t = transaction.Transaction()
t.note("commit %r to %r" % (src, dst))
self._storage.tpc_begin(t)
tid, oids = self._storage.commitVersion(src, dst, t)
@@ -233,7 +233,7 @@
return oids
def _abortVersion(self, ver):
- t = Transaction()
+ t = transaction.Transaction()
t.note("abort %r" % ver)
self._storage.tpc_begin(t)
tid, oids = self._storage.abortVersion(ver, t)
=== Zope3/src/ZODB/tests/RevisionStorage.py 1.6 => 1.6.10.1 ===
--- Zope3/src/ZODB/tests/RevisionStorage.py:1.6 Mon Dec 29 17:03:52 2003
+++ Zope3/src/ZODB/tests/RevisionStorage.py Tue Mar 30 15:19:02 2004
@@ -16,9 +16,10 @@
from ZODB.tests.MinPO import MinPO
from ZODB.tests.StorageTestBase import \
zodb_unpickle, zodb_pickle, snooze, handle_serials
-from ZODB.Transaction import Transaction
from ZODB.utils import p64, u64
+import transaction
+
ZERO = '\0'*8
class RevisionStorage:
@@ -142,7 +143,7 @@
oid = self._storage.new_oid()
def helper(tid, revid, x):
data = zodb_pickle(MinPO(x))
- t = Transaction()
+ t = transaction.Transaction()
try:
self._storage.tpc_begin(t, p64(tid))
r1 = self._storage.store(oid, revid, data, '', t)
=== Zope3/src/ZODB/tests/RecoveryStorage.py 1.12 => 1.12.8.1 ===
--- Zope3/src/ZODB/tests/RecoveryStorage.py:1.12 Thu Feb 19 13:35:23 2004
+++ Zope3/src/ZODB/tests/RecoveryStorage.py Tue Mar 30 15:19:02 2004
@@ -13,7 +13,7 @@
##############################################################################
"""More recovery and iterator tests."""
-from ZODB.Transaction import Transaction
+from transaction import Transaction
from ZODB.tests.IteratorStorage import IteratorDeepCompare
from ZODB.tests.StorageTestBase import MinPO, zodb_unpickle, snooze
from ZODB import DB
=== Zope3/src/ZODB/tests/ReadOnlyStorage.py 1.10 => 1.10.8.1 ===
--- Zope3/src/ZODB/tests/ReadOnlyStorage.py:1.10 Tue Feb 17 20:12:59 2004
+++ Zope3/src/ZODB/tests/ReadOnlyStorage.py Tue Mar 30 15:19:02 2004
@@ -12,7 +12,7 @@
#
##############################################################################
from ZODB.POSException import ReadOnlyError, Unsupported
-from ZODB.Transaction import Transaction
+import transaction
class ReadOnlyStorage:
@@ -47,7 +47,7 @@
def checkWriteMethods(self):
self._make_readonly()
self.assertRaises(ReadOnlyError, self._storage.new_oid)
- t = Transaction()
+ t = transaction.Transaction()
self.assertRaises(ReadOnlyError, self._storage.tpc_begin, t)
if self._storage.supportsVersions():
=== Zope3/src/ZODB/tests/PackableStorage.py 1.37 => 1.37.2.1 ===
--- Zope3/src/ZODB/tests/PackableStorage.py:1.37 Wed Mar 17 14:10:40 2004
+++ Zope3/src/ZODB/tests/PackableStorage.py Tue Mar 30 15:19:02 2004
@@ -127,7 +127,7 @@
try:
self._storage.load(ZERO, '')
except KeyError:
- from ZODB.Transaction import Transaction
+ from transaction import Transaction
file = StringIO()
p = cPickle.Pickler(file, 1)
p.dump((PersistentMapping, None))
=== Zope3/src/ZODB/tests/MTStorage.py 1.15.2.1 => 1.15.2.2 ===
--- Zope3/src/ZODB/tests/MTStorage.py:1.15.2.1 Thu Mar 18 16:18:33 2004
+++ Zope3/src/ZODB/tests/MTStorage.py Tue Mar 30 15:19:02 2004
@@ -3,13 +3,13 @@
import threading
import time
-import ZODB
from persistent.mapping import PersistentMapping
+import transaction
+import ZODB
from ZODB.tests.StorageTestBase \
import zodb_pickle, zodb_unpickle, handle_serials
from ZODB.tests.MinPO import MinPO
-from ZODB.Transaction import Transaction
from ZODB.POSException import ConflictError
SHORT_DELAY = 0.01
@@ -127,7 +127,7 @@
def dostore(self, i):
data = zodb_pickle(MinPO((self.getName(), i)))
- t = Transaction()
+ t = transaction.Transaction()
oid = self.oid()
self.pause()
=== Zope3/src/ZODB/tests/IteratorStorage.py 1.19 => 1.19.8.1 ===
--- Zope3/src/ZODB/tests/IteratorStorage.py:1.19 Tue Feb 17 20:12:59 2004
+++ Zope3/src/ZODB/tests/IteratorStorage.py Tue Mar 30 15:19:02 2004
@@ -20,8 +20,8 @@
from ZODB.tests.MinPO import MinPO
from ZODB.tests.StorageTestBase import zodb_pickle, zodb_unpickle
from ZODB.utils import U64, p64
-from ZODB.Transaction import Transaction
+from transaction import Transaction
class IteratorCompare:
=== Zope3/src/ZODB/tests/HistoryStorage.py 1.14 => 1.14.2.1 ===
--- Zope3/src/ZODB/tests/HistoryStorage.py:1.14 Thu Feb 26 19:31:55 2004
+++ Zope3/src/ZODB/tests/HistoryStorage.py Tue Mar 30 15:19:02 2004
@@ -17,8 +17,8 @@
all these tests.
"""
-from ZODB.Transaction import Transaction
from ZODB.tests.MinPO import MinPO
+from transaction import Transaction
class HistoryStorage:
def checkSimpleHistory(self):
=== Zope3/src/ZODB/tests/ConflictResolution.py 1.15 => 1.15.2.1 ===
--- Zope3/src/ZODB/tests/ConflictResolution.py:1.15 Thu Feb 26 19:31:55 2004
+++ Zope3/src/ZODB/tests/ConflictResolution.py Tue Mar 30 15:19:02 2004
@@ -13,9 +13,9 @@
##############################################################################
"""Tests for application-level conflict resolution."""
-from ZODB.Transaction import Transaction
from ZODB.POSException import ConflictError, UndoError
from persistent import Persistent
+from transaction import Transaction
from ZODB.tests.StorageTestBase import zodb_unpickle, zodb_pickle
=== Zope3/src/ZODB/tests/BasicStorage.py 1.28 => 1.28.10.1 ===
--- Zope3/src/ZODB/tests/BasicStorage.py:1.28 Wed Dec 24 11:01:58 2003
+++ Zope3/src/ZODB/tests/BasicStorage.py Tue Mar 30 15:19:02 2004
@@ -19,20 +19,20 @@
All storages should be able to pass these tests.
"""
-from ZODB.Transaction import Transaction
from ZODB import POSException
-
from ZODB.tests.MinPO import MinPO
from ZODB.tests.StorageTestBase \
import zodb_unpickle, zodb_pickle, handle_serials
+import transaction
+
ZERO = '\0'*8
class BasicStorage:
def checkBasics(self):
- t = Transaction()
+ t = transaction.Transaction()
self._storage.tpc_begin(t)
# This should simply return
self._storage.tpc_begin(t)
@@ -44,10 +44,10 @@
self.assertRaises(
POSException.StorageTransactionError,
self._storage.store,
- 0, 0, 0, 0, Transaction())
+ 0, 0, 0, 0, transaction.Transaction())
try:
- self._storage.abortVersion('dummy', Transaction())
+ self._storage.abortVersion('dummy', transaction.Transaction())
except (POSException.StorageTransactionError,
POSException.VersionCommitError):
pass # test passed ;)
@@ -55,7 +55,7 @@
assert 0, "Should have failed, invalid transaction."
try:
- self._storage.commitVersion('dummy', 'dummer', Transaction())
+ self._storage.commitVersion('dummy', 'dummer', transaction.Transaction())
except (POSException.StorageTransactionError,
POSException.VersionCommitError):
pass # test passed ;)
@@ -65,13 +65,13 @@
self.assertRaises(
POSException.StorageTransactionError,
self._storage.store,
- 0, 1, 2, 3, Transaction())
+ 0, 1, 2, 3, transaction.Transaction())
self._storage.tpc_abort(t)
def checkSerialIsNoneForInitialRevision(self):
eq = self.assertEqual
oid = self._storage.new_oid()
- txn = Transaction()
+ txn = transaction.Transaction()
self._storage.tpc_begin(txn)
# Use None for serial. Don't use _dostore() here because that coerces
# serial=None to serial=ZERO.
@@ -120,7 +120,7 @@
def checkWriteAfterAbort(self):
oid = self._storage.new_oid()
- t = Transaction()
+ t = transaction.Transaction()
self._storage.tpc_begin(t)
self._storage.store(oid, ZERO, zodb_pickle(MinPO(5)), '', t)
# Now abort this transaction
@@ -133,7 +133,7 @@
oid1 = self._storage.new_oid()
revid1 = self._dostore(oid=oid1, data=MinPO(-2))
oid = self._storage.new_oid()
- t = Transaction()
+ t = transaction.Transaction()
self._storage.tpc_begin(t)
self._storage.store(oid, ZERO, zodb_pickle(MinPO(5)), '', t)
# Now abort this transaction
@@ -176,7 +176,7 @@
def checkTwoArgBegin(self):
# XXX how standard is three-argument tpc_begin()?
- t = Transaction()
+ t = transaction.Transaction()
tid = '\0\0\0\0\0psu'
self._storage.tpc_begin(t, tid)
oid = self._storage.new_oid()
@@ -205,7 +205,7 @@
def checkNote(self):
oid = self._storage.new_oid()
- t = Transaction()
+ t = transaction.Transaction()
self._storage.tpc_begin(t)
t.note('this is a test')
self._storage.store(oid, ZERO, zodb_pickle(MinPO(5)), '', t)
More information about the Zope3-Checkins
mailing list