[Zope3-checkins] CVS: Zope3/src/zope/component/tests - test_api.py:1.19 test_presentation.py:1.4

Jim Fulton jim at zope.com
Wed Mar 31 18:26:26 EST 2004


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

Modified Files:
	test_api.py test_presentation.py 
Log Message:
Rearranged the signatures of getMultiView and queryMultiView by moving
the name argument after the providing argument and making the name
optional. This makes multi-views more adapter-like. Multi-view lookup
by interface will be much more common than lookup by name (or name and
interfaace).


=== Zope3/src/zope/component/tests/test_api.py 1.18 => 1.19 ===
--- Zope3/src/zope/component/tests/test_api.py:1.18	Thu Mar 18 07:19:27 2004
+++ Zope3/src/zope/component/tests/test_api.py	Wed Mar 31 18:26:26 2004
@@ -286,12 +286,12 @@
                self.context, self.other, self.request = context, other, request
 
         self.assertEquals(
-            queryMultiView((ob, ob2), 'foo', request, I3, 42), 42)
+            queryMultiView((ob, ob2), request, I3, 'foo', 42), 42)
 
         getService(None, servicenames.Presentation).provideAdapter(
             IRequest, MV, 'foo', (I1, I2), I3)
 
-        view = queryMultiView((ob, ob2), 'foo', request, I3)
+        view = queryMultiView((ob, ob2), request, I3, 'foo')
         self.assertEquals(view.__class__, MV)
         self.assertEquals(view.context, ob)
         self.assertEquals(view.other, ob2)


=== Zope3/src/zope/component/tests/test_presentation.py 1.3 => 1.4 ===
--- Zope3/src/zope/component/tests/test_presentation.py:1.3	Mon Mar 15 15:42:28 2004
+++ Zope3/src/zope/component/tests/test_presentation.py	Wed Mar 31 18:26:26 2004
@@ -91,7 +91,7 @@
     >>> bob = Contact()
     >>> acme = Company()
     
-    >>> v = s.queryMultiView((bob, acme), 'foo', request)
+    >>> v = s.queryMultiView((bob, acme), request, name='foo')
     >>> v.__class__.__name__
     'ContactInCompanyView'
     >>> v.contact is bob
@@ -105,7 +105,7 @@
     ...                  contexts=[IContact, IFamily], name='foo')
     
     >>> smith = Family()
-    >>> v = s.queryMultiView((bob, smith), 'foo', request)
+    >>> v = s.queryMultiView((bob, smith), request, name='foo')
     >>> v.__class__.__name__
     'ContactInFamilyView'
     >>> v.contact is bob




More information about the Zope3-Checkins mailing list