[Zope3-checkins] CVS: Packages3/Interface/tests - testVerify.py:1.7 IFoo.py:NONE dummy.py:NONE
Steve Alexander
steve@cat-box.net
Fri, 13 Jun 2003 10:42:16 -0400
Update of /cvs-repository/Packages3/Interface/tests
In directory cvs.zope.org:/tmp/cvs-serv29349/tests
Modified Files:
testVerify.py
Removed Files:
IFoo.py dummy.py
Log Message:
removed final dependencies on zope.interface.implements.
Use of __implements__ to say what a module implements will not be
supported in the future in Zope 2.
More generally, use of an instance's __implements__ attribute to say what
the instance supports will not be supported in the future in Zope 2.
=== Packages3/Interface/tests/testVerify.py 1.6 => 1.7 ===
--- Packages3/Interface/tests/testVerify.py:1.6 Fri Apr 18 06:03:20 2003
+++ Packages3/Interface/tests/testVerify.py Fri Jun 13 10:42:15 2003
@@ -36,7 +36,7 @@
self.assertRaises(DoesNotImplement, verifyClass, I, C)
- C.__implements__=I
+ C.__implements__ = I
verifyClass(I, C)
@@ -47,16 +47,16 @@
class C:
- __implements__=I
+ __implements__ = I
self.assertRaises(BrokenImplementation, verifyClass, I, C)
- C.f=lambda self: None
+ C.f = lambda self: None
verifyClass(I, C)
def testMissingAttr_with_Extended_Interface(self):
-
+
class II(Interface):
def f():
pass
@@ -66,11 +66,11 @@
class C:
- __implements__=I
+ __implements__ = I
self.assertRaises(BrokenImplementation, verifyClass, I, C)
- C.f=lambda self: None
+ C.f = lambda self: None
verifyClass(I, C)
@@ -83,28 +83,28 @@
def f(self, b): pass
- __implements__=I
+ __implements__ = I
# We no longer require names to match.
#self.assertRaises(BrokenMethodImplementation, verifyClass, I, C)
- C.f=lambda self, a: None
+ C.f = lambda self, a: None
verifyClass(I, C)
- C.f=lambda self, **kw: None
+ C.f = lambda self, **kw: None
self.assertRaises(BrokenMethodImplementation, verifyClass, I, C)
- C.f=lambda self, a, *args: None
+ C.f = lambda self, a, *args: None
verifyClass(I, C)
- C.f=lambda self, a, *args, **kw: None
+ C.f = lambda self, a, *args, **kw: None
verifyClass(I, C)
- C.f=lambda self, *args: None
+ C.f = lambda self, *args: None
verifyClass(I, C)
@@ -117,15 +117,15 @@
def f(self, a, b): pass
- __implements__=I
+ __implements__ = I
self.assertRaises(BrokenMethodImplementation, verifyClass, I, C)
- C.f=lambda self, a: None
+ C.f = lambda self, a: None
verifyClass(I, C)
- C.f=lambda self, a, b=None: None
+ C.f = lambda self, a, b=None: None
verifyClass(I, C)
@@ -138,11 +138,11 @@
def f(self, a): pass
- __implements__=I
+ __implements__ = I
self.assertRaises(BrokenMethodImplementation, verifyClass, I, C)
- C.f=lambda self, a, *foo: None
+ C.f = lambda self, a, *foo: None
verifyClass(I, C)
@@ -155,26 +155,18 @@
def f(self, a): pass
- __implements__=I
+ __implements__ = I
self.assertRaises(BrokenMethodImplementation, verifyClass, I, C)
- C.f=lambda self, a, **foo: None
+ C.f = lambda self, a, **foo: None
verifyClass(I, C)
- def testModule(self):
-
- from Interface.tests.IFoo import IFoo
- from Interface.tests import dummy
-
- verifyObject(IFoo, dummy)
-
-
def test_suite():
- loader=unittest.TestLoader()
+ loader = unittest.TestLoader()
return loader.loadTestsFromTestCase(Test)
-if __name__=='__main__':
+if __name__ == '__main__':
unittest.TextTestRunner().run(test_suite())
=== Removed File Packages3/Interface/tests/IFoo.py ===
=== Removed File Packages3/Interface/tests/dummy.py ===