[Zope-CVS] CVS: Products/Ape/lib/apelib/tests -
teststorage.py:1.5.2.4 testzope2fs.py:1.4.4.4
zope2testbase.py:1.5.2.3
Shane Hathaway
shane at zope.com
Thu Dec 25 23:22:35 EST 2003
Update of /cvs-repository/Products/Ape/lib/apelib/tests
In directory cvs.zope.org:/tmp/cvs-serv7640/lib/apelib/tests
Modified Files:
Tag: ape-0_8-branch
teststorage.py testzope2fs.py zope2testbase.py
Log Message:
Renamed ConflictError to OIDConflictError.
ZODB conflict errors are related to high load and can be solved by
improving capacity. OID conflicts, OTOH, are really programming errors.
They indicate that someone is trying to write different objects for
a single OID.
=== Products/Ape/lib/apelib/tests/teststorage.py 1.5.2.3 => 1.5.2.4 ===
--- Products/Ape/lib/apelib/tests/teststorage.py:1.5.2.3 Sat Dec 20 23:24:05 2003
+++ Products/Ape/lib/apelib/tests/teststorage.py Thu Dec 25 23:22:34 2003
@@ -26,7 +26,7 @@
from apelib.zodb3.storage import ApeStorage
from apelib.zodb3.resource import StaticResource
from apelib.zodb3.utils import copyOf
-from apelib.core.interfaces import StoreError
+from apelib.core.interfaces import OIDConflictError
from serialtestbase import SerialTestBase, TestObject
@@ -237,8 +237,7 @@
ob1 = self._writeBasicObject(conn1)
ob1.strdata = 'def'
conn1.setSerial(ob1, '\0' * 8) # Pretend that it's new
- self.assertRaises(ZODB.POSException.ConflictError,
- get_transaction().commit)
+ self.assertRaises(OIDConflictError, get_transaction().commit)
finally:
conn1.close()
=== Products/Ape/lib/apelib/tests/testzope2fs.py 1.4.4.3 => 1.4.4.4 ===
--- Products/Ape/lib/apelib/tests/testzope2fs.py:1.4.4.3 Sat Dec 20 23:24:05 2003
+++ Products/Ape/lib/apelib/tests/testzope2fs.py Thu Dec 25 23:22:34 2003
@@ -23,12 +23,12 @@
from tempfile import mktemp
from cStringIO import StringIO
-from ZODB.POSException import ConflictError
from OFS.Application import Application
from OFS.Image import File, manage_addImage, manage_addFile
from Products.PythonScripts.PythonScript import PythonScript
from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate
+from apelib.core.interfaces import OIDConflictError
from apelib.zodb3.db import ApeDB
from apelib.zodb3.storage import ApeStorage
from apelib.zodb3.resource import StaticResource
@@ -257,7 +257,7 @@
script = PythonScript('script0.py')
script.write('##title=test script\nreturn "Hello, world!"')
f._setObject(script.id, script, set_owner=0)
- self.assertRaises(ConflictError, get_transaction().commit)
+ self.assertRaises(OIDConflictError, get_transaction().commit)
finally:
conn.close()
=== Products/Ape/lib/apelib/tests/zope2testbase.py 1.5.2.2 => 1.5.2.3 ===
--- Products/Ape/lib/apelib/tests/zope2testbase.py:1.5.2.2 Tue Dec 23 00:52:36 2003
+++ Products/Ape/lib/apelib/tests/zope2testbase.py Thu Dec 25 23:22:34 2003
@@ -34,6 +34,7 @@
from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate
from apelib.zope2.setup.patches import applySetObPatch
+from apelib.core.interfaces import OIDConflictError
class TestFolder(Folder):
@@ -370,8 +371,7 @@
app = conn.root()['Application']
app.some_attr = 'stuff'
conn.setSerial(app, '\0' * 8) # Pretend that it's new
- self.assertRaises(POSException.ConflictError,
- get_transaction().commit)
+ self.assertRaises(OIDConflictError, get_transaction().commit)
finally:
conn.close()
More information about the Zope-CVS
mailing list