Commit 15548c4a authored by Jim Fulton's avatar Jim Fulton

Fixed some typos in some error handling code.

parent 9a7ad8f0
...@@ -167,7 +167,7 @@ class DemoStorage(object): ...@@ -167,7 +167,7 @@ class DemoStorage(object):
try: try:
return self.base.loadBlob(oid, serial) return self.base.loadBlob(oid, serial)
except AttributeError: except AttributeError:
if not zope.interface.IBlobStorage.providBy(self.base): if not ZODB.interfaces.IBlobStorage.providedBy(self.base):
raise ZODB.POSException.POSKeyError(oid, serial) raise ZODB.POSException.POSKeyError(oid, serial)
raise raise
except AttributeError: except AttributeError:
...@@ -182,7 +182,7 @@ class DemoStorage(object): ...@@ -182,7 +182,7 @@ class DemoStorage(object):
try: try:
return self.base.openCommittedBlobFile(oid, serial, blob) return self.base.openCommittedBlobFile(oid, serial, blob)
except AttributeError: except AttributeError:
if not zope.interface.IBlobStorage.providBy(self.base): if not ZODB.interfaces.IBlobStorage.providedBy(self.base):
raise ZODB.POSException.POSKeyError(oid, serial) raise ZODB.POSException.POSKeyError(oid, serial)
raise raise
except AttributeError: except AttributeError:
......
...@@ -156,6 +156,21 @@ def testSomeDelegation(): ...@@ -156,6 +156,21 @@ def testSomeDelegation():
""" """
def blob_pos_key_error_with_non_blob_base():
"""
>>> storage = ZODB.DemoStorage.DemoStorage()
>>> storage.loadBlob(ZODB.utils.p64(1), ZODB.utils.p64(1))
Traceback (most recent call last):
...
POSKeyError: 0x01
>>> storage.openCommittedBlobFile(ZODB.utils.p64(1), ZODB.utils.p64(1))
Traceback (most recent call last):
...
POSKeyError: 0x01
"""
def test_suite(): def test_suite():
suite = unittest.TestSuite(( suite = unittest.TestSuite((
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment