[Zope3-checkins] CVS: Zope3/src/zope/app/tests -
test_decorator.py:1.2.6.1
Jim Fulton
jim at zope.com
Sun Oct 12 16:40:42 EDT 2003
Update of /cvs-repository/Zope3/src/zope/app/tests
In directory cvs.zope.org:/tmp/cvs-serv8539/src/zope/app/tests
Modified Files:
Tag: adaptergeddon-branch
test_decorator.py
Log Message:
Got tests to pass on branch.
=== Zope3/src/zope/app/tests/test_decorator.py 1.2 => 1.2.6.1 ===
--- Zope3/src/zope/app/tests/test_decorator.py:1.2 Sun Sep 21 13:33:33 2003
+++ Zope3/src/zope/app/tests/test_decorator.py Sun Oct 12 16:40:12 2003
@@ -65,101 +65,24 @@
['I4', 'I3', 'I1', 'I2']
"""
-def test_providedBy_signature_w_new_style_class():
- """
- >>> class X(object):
- ... implements(I3)
-
- >>> x = X()
-
- >>> int(providedBy(x).__signature__ == implementedBy(X).__signature__)
- 1
-
- >>> int(providedBy(Decorator(x)).__signature__ ==
- ... implementedBy(X).__signature__)
- 1
-
- >>> directlyProvides(x, I4)
- >>> int(providedBy(x).__signature__ ==
- ... (directlyProvidedBy(x).__signature__,
- ... implementedBy(X).__signature__,
- ... )
- ... )
- 1
-
- >>> int(providedBy(D1(x)).__signature__ ==
- ... (
- ... (directlyProvidedBy(x).__signature__,
- ... implementedBy(X).__signature__,
- ... ),
- ... implementedBy(D1).__signature__,
- ... )
- ... )
- 1
-
- >>> int(providedBy(D2(D1(x))).__signature__ ==
- ... (
- ... (
- ... (directlyProvidedBy(x).__signature__,
- ... implementedBy(X).__signature__,
- ... ),
- ... implementedBy(D1).__signature__,
- ... ),
- ... implementedBy(D2).__signature__,
- ... )
- ... )
- 1
-
- """
-
-def test_providedBy_signature_w_classic_class():
+def test_providedBy_iter_w_classic_class():
"""
>>> class X:
... implements(I3)
>>> x = X()
-
-
- >>> int(providedBy(x).__signature__ == implementedBy(X).__signature__)
- 1
-
- >>> int(providedBy(Decorator(x)).__signature__ ==
- ... implementedBy(X).__signature__)
- 1
-
>>> directlyProvides(x, I4)
- >>> int(providedBy(x).__signature__ ==
- ... (directlyProvidedBy(x).__signature__,
- ... implementedBy(X).__signature__,
- ... )
- ... )
- 1
+ >>> [interface.getName() for interface in list(providedBy(x))]
+ ['I4', 'I3']
- >>> int(providedBy(D1(x)).__signature__ ==
- ... (
- ... (directlyProvidedBy(x).__signature__,
- ... implementedBy(X).__signature__,
- ... ),
- ... implementedBy(D1).__signature__,
- ... )
- ... )
- 1
-
- >>> int(providedBy(D2(D1(x))).__signature__ ==
- ... (
- ... (
- ... (directlyProvidedBy(x).__signature__,
- ... implementedBy(X).__signature__,
- ... ),
- ... implementedBy(D1).__signature__,
- ... ),
- ... implementedBy(D2).__signature__,
- ... )
- ... )
- 1
+ >>> [interface.getName() for interface in list(providedBy(D1(x)))]
+ ['I4', 'I3', 'I1']
+ >>> [interface.getName() for interface in list(providedBy(D2(D1(x))))]
+ ['I4', 'I3', 'I1', 'I2']
"""
+
class Thing:
pass
More information about the Zope3-Checkins
mailing list