[Zope3-checkins] CVS: Zope3/src/zope/component/tests - test_presentation.py:1.3

Jim Fulton jim at zope.com
Mon Mar 15 15:42:58 EST 2004


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

Modified Files:
	test_presentation.py 
Log Message:
Factory semantics are now provided by the layers, rather than
the underlying adapter registry. These semantics are provided in a
mix-in class.

Only a single factory can be provided.

Changed the registration api to be more consistent with the underlying
adapter registry api and, in general, to be simpler.


=== Zope3/src/zope/component/tests/test_presentation.py 1.2 => 1.3 ===
--- Zope3/src/zope/component/tests/test_presentation.py:1.2	Fri Nov 21 12:09:27 2003
+++ Zope3/src/zope/component/tests/test_presentation.py	Mon Mar 15 15:42:28 2004
@@ -48,7 +48,7 @@
 
     >>> request = Request()
 
-    >>> s.provideAdapter(IRequest, [MyView], contexts=[IContact], name='foo',
+    >>> s.provideAdapter(IRequest, MyView, contexts=[IContact], name='foo',
     ...                  layer='custom')
 
     >>> c = Contact()
@@ -85,7 +85,7 @@
     >>> s = GlobalPresentationService()
     >>> request = Request()
 
-    >>> s.provideAdapter(IRequest, [ContactInCompanyView],
+    >>> s.provideAdapter(IRequest, ContactInCompanyView,
     ...                  contexts=[IContact, ICompany], name='foo')
 
     >>> bob = Contact()
@@ -101,7 +101,7 @@
     >>> v.request is request
     True
 
-    >>> s.provideAdapter(IRequest, [ContactInFamilyView],
+    >>> s.provideAdapter(IRequest, ContactInFamilyView,
     ...                  contexts=[IContact, IFamily], name='foo')
     
     >>> smith = Family()
@@ -125,7 +125,7 @@
 
     >>> s = GlobalPresentationService()
     >>> request = Request()
-    >>> s.provideView(IContact, 'foo', IRequest, [MyView])
+    >>> s.provideView(IContact, 'foo', IRequest, MyView)
 
 
     >>> c = Contact()
@@ -212,10 +212,10 @@
     >>> class MyResource:
     ...    def __init__(self, request):
     ...        self.request = request
-    >>> s.provideAdapter(IRequest, [MyResource], name='foo', layer='custom')
+    >>> s.provideAdapter(IRequest, MyResource, name='foo', layer='custom')
     >>> s.queryResource('foo', request)
 
-    >>> s.provideAdapter(IRequest, [MyView], contexts=[IContact], name='foo',
+    >>> s.provideAdapter(IRequest, MyView, contexts=[IContact], name='foo',
     ...                  layer='custom')
 
     >>> c = Contact()




More information about the Zope3-Checkins mailing list