[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Services/ServiceManager/Views/Browser/tests - testAdder.py:1.1.4.1.2.1 testBindings.py:1.1.4.1.2.1 testContents.py:1.1.4.1.2.1
Jim Fulton
jim@zope.com
Wed, 29 May 2002 11:10:16 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Services/ServiceManager/Views/Browser/tests
In directory cvs.zope.org:/tmp/cvs-serv12181/lib/python/Zope/App/OFS/Services/ServiceManager/Views/Browser/tests
Modified Files:
Tag: Zope3InWonderland-branch
testAdder.py testBindings.py testContents.py
Log Message:
- Added permission_id attribute to adapter and utility directives.
- Got rid of old getView, getResource, and getDefaultViewName.
Renamed getRequestView to getView (and so on).
Changed view interface to use context, rather than getContext.
Introduced notion of presentation types (e.g. IBrowserPresentation,
which is cleaner than IBrowserPublisher).
- Began converting to get/queryFoo, which is much nicer.
- Many formatting fixups.
=== Zope3/lib/python/Zope/App/OFS/Services/ServiceManager/Views/Browser/tests/testAdder.py 1.1.4.1 => 1.1.4.1.2.1 ===
def _TestView__newContext(self):
- from Zope.App.OFS.Services.ServiceManager.ServiceManager import ServiceManager
+ from Zope.App.OFS.Services.ServiceManager.ServiceManager \
+ import ServiceManager
return ServiceManager()
def _TestView__newView(self, container):
- from Zope.App.OFS.Services.ServiceManager.Views.Browser.Adder import Adder
- return Adder(container)
+ from Zope.App.OFS.Services.ServiceManager.Views.Browser.Adder \
+ import Adder
+ return Adder(container, None)
def _TestAdderView__registry(self):
return 'AddableServices'
=== Zope3/lib/python/Zope/App/OFS/Services/ServiceManager/Views/Browser/tests/testBindings.py 1.1.4.1 => 1.1.4.1.2.1 ===
def testGetServicesTable(self):
- view = Bindings(self.sm)
+ view = Bindings(self.sm, None)
self.assertEqual(len(view.getServicesTable()), 8) #that is, 2+6
def testServiceTableBound(self):
- view = Bindings(self.sm)
+ view = Bindings(self.sm, None)
services = view.getServicesTable()
serviceMap = None
for sMap in services:
@@ -84,7 +84,7 @@
## service2 provided globally?
##
def testServiceTableNone(self):
- view = Bindings(self.sm)
+ view = Bindings(self.sm, None)
services = view.getServicesTable()
serviceMap = None
for sMap in services:
=== Zope3/lib/python/Zope/App/OFS/Services/ServiceManager/Views/Browser/tests/testContents.py 1.1.4.1 => 1.1.4.1.2.1 ===
def _TestView__newView(self, container):
- return ServiceManagerContents(container)
+ return ServiceManagerContents(container, None)
- def testExtractContents( self ):
+ def testExtractContents(self):
""" Does _extractContents return the correct information? """
- smc = ServiceManagerContents( None )
- info = smc._extractContentInfo( ('dummy', Dummy(),) )
+ smc = ServiceManagerContents(None , None)
+ info = smc._extractContentInfo(('dummy', Dummy(),))
- self.assert_( 'IDummy' in info['interfaces'] )
+ self.assert_('IDummy' in info['interfaces'])
- def testInfo( self ):
+ def testInfo(self):
""" Do we get the correct information back from
ServiceManagerContents?
"""
sm = ServiceManager()
dummy = Dummy()
- sm.setObject( 'dummy', dummy )
+ sm.setObject('dummy', dummy)
- smc = ServiceManagerContents( sm )
+ smc = ServiceManagerContents(sm, None)
info_list = smc.listContentInfo()
- self.assertEquals( len( info_list ), 1 )
+ self.assertEquals(len(info_list), 1)
interfaces = [ x['interfaces'] for x in info_list ]
- self.assert_( 'IDummy' in interfaces[0] )
+ self.assert_('IDummy' in interfaces[0])
def test_suite():
loader = unittest.TestLoader()
- return loader.loadTestsFromTestCase( Test )
+ return loader.loadTestsFromTestCase(Test)
if __name__=='__main__':
unittest.main()