[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZMI/tests - testZMIViewUtility.py:1.1.2.2
Kapil
k_vertigo@yahoo.com
Fri, 1 Feb 2002 12:40:19 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/ZMI/tests
In directory cvs.zope.org:/tmp/cvs-serv915
Modified Files:
Tag: Zope-3x-branch
testZMIViewUtility.py
Log Message:
=== Zope3/lib/python/Zope/App/ZMI/tests/testZMIViewUtility.py 1.1.2.1 => 1.1.2.2 ===
from Zope.App.ZMI.IZMIViewService import IZMIViewService
-from Zope.ComponentArchitecture import getService, provideService, _clear
+from Zope.ComponentArchitecture import getService, provideService, defineService, _clear
from Zope.App.ZMI.ZMIViewUtility import ZMIViewUtility
class Service:
__implements__ = IZMIViewService
- def getViews(ob):
+ def getViews(self, ob):
return [('l1', 'a1'), ('l2', 'a2'), ('l3', 'a3'),]
@@ -29,15 +29,18 @@
def setUp(self):
defineService('ZMIViewService', IZMIViewService)
- provideService('ZMIViewService', Service)
+ provideService('ZMIViewService', Service())
def tearDown(self):
_clear()
def test(self):
v = ZMIViewUtility(None)
- self.assertEqual(v.views(),
- {'l1': 'a1', 'l2': 'a2', 'l3': 'a3'})
+ self.assertEqual(v.getZMIViews(),
+ [{'label':'l1', 'action':'a1'},
+ {'label':'l2', 'action':'a2'},
+ {'label':'l3', 'action':'a3'}
+ ])
def test_suite():