Commit 3871b390 authored by Martijn Pieters's avatar Martijn Pieters

Backport Interface Verify bugfix from Zope 3.

parent dc50791c
......@@ -44,7 +44,7 @@ def _verify(iface, candidate, tentative=0, vtype=None):
if not tentative and not tester( candidate ):
raise DoesNotImplement(iface)
for n, d in iface.namesAndDescriptions():
for n, d in iface.namesAndDescriptions(1):
if not hasattr(candidate, n):
raise BrokenImplementation(iface, n)
......
......@@ -14,7 +14,7 @@
"""
Revision information:
$Id: testVerify.py,v 1.3 2002/08/14 21:35:33 mj Exp $
$Id: testVerify.py,v 1.4 2002/11/11 19:53:16 mj Exp $
"""
from __future__ import nested_scopes
......@@ -55,6 +55,25 @@ class Test(unittest.TestCase):
verifyClass(I, C)
def testMissingAttr_with_Extended_Interface(self):
class II(Interface):
def f():
pass
class I(II):
pass
class C:
__implements__=I
self.assertRaises(BrokenImplementation, verifyClass, I, C)
C.f=lambda self: None
verifyClass(I, C)
def testWrongArgs(self):
class I(Interface):
......
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