[Zodb-checkins] CVS: Zope3/src/zope/interface/tests -
test_type.py:1.7 test_verify.py:1.4
Steve Alexander
steve at cat-box.net
Sat Jun 7 03:37:31 EDT 2003
Update of /cvs-repository/Zope3/src/zope/interface/tests
In directory cvs.zope.org:/tmp/cvs-serv4294/src/zope/interface/tests
Modified Files:
test_type.py test_verify.py
Log Message:
updated to use new-style interface declarations
=== Zope3/src/zope/interface/tests/test_type.py 1.6 => 1.7 ===
--- Zope3/src/zope/interface/tests/test_type.py:1.6 Thu May 1 15:35:44 2003
+++ Zope3/src/zope/interface/tests/test_type.py Sat Jun 7 02:37:30 2003
@@ -19,7 +19,7 @@
import unittest
from zope.interface.type import TypeRegistry
-from zope.interface import Interface
+from zope.interface import Interface, implements
def getAllForObject(reg, ob):
all = list(reg.getAllForObject(ob))
@@ -52,9 +52,9 @@
self.assertEqual(getTypesMatching(reg, I2), [I2])
self.assertEqual(getTypesMatching(reg, I3), [])
- class C1: __implements__ = I1
- class C2: __implements__ = I2
- class C3: __implements__ = I3
+ class C1: implements(I1)
+ class C2: implements(I2)
+ class C3: implements(I3)
class C: pass
self.assertEqual(getAllForObject(reg, C1()), [])
@@ -131,11 +131,11 @@
class I2(I1): pass
class I3(I1): pass
class I4(I2, I3): pass
- class C1: __implements__ = I1
- class C2: __implements__ = I2
- class C3: __implements__ = I3
- class C4: __implements__ = I4
- class C5: __implements__ = I1, I2, I3, I4
+ class C1: implements(I1)
+ class C2: implements(I2)
+ class C3: implements(I3)
+ class C4: implements(I4)
+ class C5: implements(I1, I2, I3, I4)
class C: pass
reg = TypeRegistry()
=== Zope3/src/zope/interface/tests/test_verify.py 1.3 => 1.4 ===
--- Zope3/src/zope/interface/tests/test_verify.py:1.3 Thu May 1 15:35:44 2003
+++ Zope3/src/zope/interface/tests/test_verify.py Sat Jun 7 02:37:30 2003
@@ -18,7 +18,7 @@
"""
-from zope.interface import Interface
+from zope.interface import Interface, implements, classImplements
from zope.interface.verify import verifyClass, verifyObject
from zope.interface.exceptions import DoesNotImplement, BrokenImplementation
from zope.interface.exceptions import BrokenMethodImplementation
@@ -35,7 +35,7 @@
self.assertRaises(DoesNotImplement, verifyClass, I, C)
- C.__implements__=I
+ classImplements(C, I)
verifyClass(I, C)
@@ -45,8 +45,7 @@
def f(): pass
class C:
-
- __implements__=I
+ implements(I)
self.assertRaises(BrokenImplementation, verifyClass, I, C)
@@ -65,7 +64,7 @@
class C:
- __implements__=I
+ implements(I)
self.assertRaises(BrokenImplementation, verifyClass, I, C)
@@ -82,7 +81,7 @@
def f(self, b): pass
- __implements__=I
+ implements(I)
# We no longer require names to match.
#self.assertRaises(BrokenMethodImplementation, verifyClass, I, C)
@@ -116,7 +115,7 @@
def f(self, a, b): pass
- __implements__=I
+ implements(I)
self.assertRaises(BrokenMethodImplementation, verifyClass, I, C)
@@ -137,7 +136,7 @@
def f(self, a): pass
- __implements__=I
+ implements(I)
self.assertRaises(BrokenMethodImplementation, verifyClass, I, C)
@@ -154,7 +153,7 @@
def f(self, a): pass
- __implements__=I
+ implements(I)
self.assertRaises(BrokenMethodImplementation, verifyClass, I, C)
More information about the Zodb-checkins
mailing list