[Zodb-checkins] CVS: Zope3/src/zope/interface/tests - test_declarations.py:1.11.8.1 test_odd_declarations.py:1.4.40.1 unitfixtures.py:1.3.22.1

Martijn Faassen m.faassen at vet.uu.nl
Fri May 7 06:36:41 EDT 2004


Update of /cvs-repository/Zope3/src/zope/interface/tests
In directory cvs.zope.org:/tmp/cvs-serv4538/src/zope/interface/tests

Modified Files:
      Tag: faassen-interfaces-branch
	test_declarations.py test_odd_declarations.py unitfixtures.py 
Log Message:
Change __implements__ to __implemented__ to avoid clash with Zope 2
interfaces. The Zope 3 tests run; the Zope 2 integration still needs to be
tested further.

Note that this change destroys any backwards compatibility code to support
old style __implements__ usage. We need to decide whether this backwards
compatibility should go (my recommendation) or whether there are reasons
to keep supporting this. The one possible reason I can come up with is
FrankenZope, but this alternative form of Zope 3 integration into Zope 2
is supposed to make FrankenZope unnecessary.


=== Zope3/src/zope/interface/tests/test_declarations.py 1.11 => 1.11.8.1 ===
--- Zope3/src/zope/interface/tests/test_declarations.py:1.11	Fri Mar  5 17:09:30 2004
+++ Zope3/src/zope/interface/tests/test_declarations.py	Fri May  7 06:36:38 2004
@@ -39,7 +39,7 @@
     implementsOnly(I3)
 
 class COnly_old(A, B):
-    __implements__ = I3
+    __implemented__ = I3
     
 class D(COnly):
     implements(I5)
@@ -76,11 +76,11 @@
 
     def test_backward_compat(self):
 
-        class C1: __implements__ = I1
-        class C2(C1): __implements__ = I2, I5
-        class C3(C2): __implements__ = I3, C2.__implements__
+        class C1: __implemented__ = I1
+        class C2(C1): __implemented__ = I2, I5
+        class C3(C2): __implemented__ = I3, C2.__implemented__
 
-        self.assert_(C3.__implements__.__class__ is tuple)
+        self.assert_(C3.__implemented__.__class__ is tuple)
 
         self.assertEqual(
             [i.getName() for i in providedBy(C3())],
@@ -96,16 +96,16 @@
             )
 
         self.assertEqual(
-            [i.getName() for i in C4.__implements__],
+            [i.getName() for i in C4.__implemented__],
             ['I4', 'I3', 'I2', 'I5'],
             )
 
-        # Note that C3.__implements__ should now be a sequence of interfaces
+        # Note that C3.__implemented__ should now be a sequence of interfaces
         self.assertEqual(
-            [i.getName() for i in C3.__implements__],
+            [i.getName() for i in C3.__implemented__],
             ['I3', 'I2', 'I5'],
             )
-        self.failIf(C3.__implements__.__class__ is tuple)
+        self.failIf(C3.__implemented__.__class__ is tuple)
 
     def test_module(self):
         import zope.interface.tests.m1


=== Zope3/src/zope/interface/tests/test_odd_declarations.py 1.4 => 1.4.40.1 ===
--- Zope3/src/zope/interface/tests/test_odd_declarations.py:1.4	Fri Aug 15 20:44:48 2003
+++ Zope3/src/zope/interface/tests/test_odd_declarations.py	Fri May  7 06:36:38 2004
@@ -33,7 +33,7 @@
 
 class Odd: __metaclass__ = odd.MetaClass
 
-class B(Odd): __implements__ = I2
+class B(Odd): __implemented__ = I2
 
 
 # XXX We are going to need more magic to make classProvides work with odd
@@ -87,7 +87,7 @@
         self.assert_(providedBy(c).extends(I31))
         self.assert_(providedBy(c).extends(I5))
 
-        class COnly(A, B): __implements__ = I31
+        class COnly(A, B): __implemented__ = I31
         class D(COnly):
             implements(I5)
 


=== Zope3/src/zope/interface/tests/unitfixtures.py 1.3 => 1.3.22.1 ===
--- Zope3/src/zope/interface/tests/unitfixtures.py:1.3	Fri Jan 23 11:59:02 2004
+++ Zope3/src/zope/interface/tests/unitfixtures.py	Fri May  7 06:36:38 2004
@@ -42,7 +42,7 @@
 
 
 
-C.__implements__=IC
+C.__implemented__=IC
 
 class I1(Interface):
     def ma():
@@ -55,15 +55,15 @@
 class I4(Interface): pass
 
 class A(I1.deferred()):
-    __implements__=I1
+    __implemented__=I1
 
 class B:
-    __implements__=I2, I3
+    __implemented__=I2, I3
 
 class D(A, B): pass
 
 class E(A, B):
-    __implements__ = A.__implements__, C.__implements__
+    __implemented__ = A.__implemented__, C.__implemented__
 
 
 class FooInterface(Interface):
@@ -86,7 +86,7 @@
 class Foo:
     """ A concrete class """
 
-    __implements__ = FooInterface,
+    __implemented__ = FooInterface,
 
     foobar = "yeah"
 




More information about the Zodb-checkins mailing list