[Zope3-checkins] CVS: Packages3/Interface/tests - unitfixtures.py:1.7 testInterface.py:1.10

Steve Alexander steve@cat-box.net
Fri, 13 Jun 2003 08:20:13 -0400


Update of /cvs-repository/Packages3/Interface/tests
In directory cvs.zope.org:/tmp/cvs-serv8805/tests

Modified Files:
	unitfixtures.py testInterface.py 
Log Message:
Updated tests semantics to reflect the slightly different semantics of
cases such as:

class X:
    __implements__ = IX
class Y:
    __implements__ = IY
class Z(X, Y):
    pass

In classic Zope 2, instances of Z would implement IX.
In Zope 2 using Zope 3 interfaces, instances of Z would implement both
IX and IY.


=== Packages3/Interface/tests/unitfixtures.py 1.6 => 1.7 ===
--- Packages3/Interface/tests/unitfixtures.py:1.6	Fri Apr 18 06:03:20 2003
+++ Packages3/Interface/tests/unitfixtures.py	Fri Jun 13 08:20:13 2003
@@ -59,6 +59,10 @@
 class B:
     __implements__=I2, I3
 
+# D doesn't explicitly have an __implements__, so D implements the combination
+# of what D's bases implement. This differs from the older Interface package,
+# in which D implemented the same as whichever base-class is first (by mro)
+# to have an __implemements__ attribute.
 class D(A, B): pass
 
 class E(A, B):


=== Packages3/Interface/tests/testInterface.py 1.9 => 1.10 ===
--- Packages3/Interface/tests/testInterface.py:1.9	Fri Apr 18 06:03:20 2003
+++ Packages3/Interface/tests/testInterface.py	Fri Jun 13 08:20:13 2003
@@ -41,7 +41,7 @@
         assert not I2.isImplementedByInstancesOf(A)
         assert I2.isImplementedByInstancesOf(B)
         assert not I2.isImplementedByInstancesOf(C)
-        assert not I2.isImplementedByInstancesOf(D)
+        assert I2.isImplementedByInstancesOf(D)
         assert not I2.isImplementedByInstancesOf(E)
 
     def testUtil(self):
@@ -72,7 +72,7 @@
         assert not I2.isImplementedBy(A())
         assert I2.isImplementedBy(B())
         assert not I2.isImplementedBy(C())
-        assert not I2.isImplementedBy(D())
+        assert I2.isImplementedBy(D())
         assert not I2.isImplementedBy(E())
 
     def testDeferredClass(self):