[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZMI/tests - testZMIViewUtility.py:1.3 testTabsDirective.py:NONE testZMIViewService.py:NONE
Jim Fulton
jim@zope.com
Tue, 18 Jun 2002 15:35:30 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/ZMI/tests
In directory cvs.zope.org:/tmp/cvs-serv23687/lib/python/Zope/App/ZMI/tests
Modified Files:
testZMIViewUtility.py
Removed Files:
testTabsDirective.py testZMIViewService.py
Log Message:
implemented
http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/ContentSensitiveBrowserMenuConfigurationDirectives
=== Zope3/lib/python/Zope/App/ZMI/tests/testZMIViewUtility.py 1.2 => 1.3 ===
from Interface import Interface
-from Zope.App.ZMI.IZMIViewService import IZMIViewService
from Zope.ComponentArchitecture import getService, getServiceManager
from Zope.App.OFS.Services.ServiceManager.tests.PlacefulSetup\
import PlacefulSetup
@@ -32,15 +31,19 @@
from Zope.Exceptions import Unauthorized
from Zope.Security.Checker import defineChecker, NamesChecker, CheckerPublic
from Zope.Security.Proxy import ProxyFactory
+from Zope.App.Publisher.Browser.IBrowserMenuService \
+ import IBrowserMenuService
+
+def d(title, action):
+ return {'action': action, 'title': title, 'description': ''}
class Service:
- __implements__ = IZMIViewService
+ __implements__ = IBrowserMenuService
- def getViews(self, ob):
- return [('l1', 'a1'),
- ('l2', 'a2/a3'),
- ('lbad', 'abad'),
- ('l3', '@@a3'),]
+ def getMenu(self, name, ob, req):
+ return [d('l1', 'a1'),
+ d('l2', 'a2/a3'),
+ d('l3', '@@a3'),]
class I(Interface): pass
class C:
@@ -73,8 +76,10 @@
PlacefulSetup.setUp(self)
defineService=getServiceManager(None).defineService
provideService=getServiceManager(None).provideService
- defineService('ZMIViewService', IZMIViewService)
- provideService('ZMIViewService', Service())
+
+
+ defineService('BrowserMenu', IBrowserMenuService)
+ provideService('BrowserMenu', Service())
getService(None,"Views").provideView(
I, 'a3', IBrowserPresentation, [V])
getService(None, "Views").provideView(None, '_traverse',
@@ -87,9 +92,9 @@
newSecurityManager('who')
v = ZMIViewUtility(ProxyFactory(ob), Request())
self.assertEqual(v.getZMIViews(),
- [{'label':'l1', 'action':'a1'},
- {'label':'l2', 'action':'a2/a3'},
- {'label':'l3', 'action':'@@a3'}
+ [{'description': '', 'title':'l1', 'action':'a1'},
+ {'description': '', 'title':'l2', 'action':'a2/a3'},
+ {'description': '', 'title':'l3', 'action':'@@a3'}
])
=== Removed File Zope3/lib/python/Zope/App/ZMI/tests/testTabsDirective.py ===
=== Removed File Zope3/lib/python/Zope/App/ZMI/tests/testZMIViewService.py ===