[Zope-Checkins] CVS: Zope/lib/python/ZODB/tests - ConflictResolution.py:1.3.8.1
Chris McDonough
chrism@zope.com
Wed, 3 Oct 2001 16:54:32 -0400
Update of /cvs-repository/Zope/lib/python/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv8814
Modified Files:
Tag: Zope-2_4-branch
ConflictResolution.py
Log Message:
Added simple test for ZClass conflict resolution avoidance.
=== Zope/lib/python/ZODB/tests/ConflictResolution.py 1.3 => 1.3.8.1 ===
class PCounter3(PCounter):
def _p_resolveConflict(self, oldState, savedState, newState):
- raise AttributeError, "no attribute"
+ raise AttributeError, "no attribute (testing conflict resolution)"
class PCounter4(PCounter):
def _p_resolveConflict(self, oldState, savedState):
@@ -65,7 +65,7 @@
data, serialno = self._storage.load(oid, '')
inst = zodb_unpickle(data)
- self.assert_(inst._value == 5)
+ self.assertEqual(inst._value, 5)
def checkUnresolvable(self):
obj = PCounter2()
@@ -85,6 +85,10 @@
self._dostoreNP,
oid, revid=revid1, data=zodb_pickle(obj))
+ def checkZClassesArentResolved(self):
+ from ZODB.ConflictResolution import bad_class
+ dummy_class_tuple = ('*foobar', ())
+ assert bad_class(dummy_class_tuple) == 1
def checkBuggyResolve1(self):
obj = PCounter3()