[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Services/ServiceManager/tests - testServiceManager.py:1.1.4.2
Jim Fulton
jim@zope.com
Mon, 10 Jun 2002 15:34:52 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Services/ServiceManager/tests
In directory cvs.zope.org:/tmp/cvs-serv5490/lib/python/Zope/App/OFS/Services/ServiceManager/tests
Modified Files:
Tag: Zope-3x-branch
testServiceManager.py
Log Message:
Implemented
http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/IContainerPythonification
Along the way:
- Converted most uses of has_key to use in.
- Fixed a bug in Interface names and namesAndDescriptions methods
that caused base class attributes to be missed.
=== Zope3/lib/python/Zope/App/OFS/Services/ServiceManager/tests/testServiceManager.py 1.1.4.1 => 1.1.4.2 ===
ts = TestService()
sm.setObject('test_service1', ts)
- self.assertEqual(sm.getObject('test_service1'), ts)
+ self.assertEqual(sm['test_service1'], ts)
def testGetService(self):
sm = ServiceManager()
@@ -87,7 +87,7 @@
sm.setObject('test_service1', ts)
sm.bindService('test_service', 'test_service1')
self.assertEqual(getService(self.rootFolder, 'test_service'), ts)
- self.assertRaises(ZopeError, sm.delObject, 'test_service1')
+ self.assertRaises(ZopeError, sm.__delitem__, 'test_service1')
def testContextServiceLookup(self):
self.rootFolder.setServiceManager(ServiceManager())
@@ -121,8 +121,9 @@
globsm=getServiceManager(None)
globsm.defineService('test_service', ITestService)
globsm.provideService('test_service', ts)
-
- self.assertEqual(getService(self.folder1, 'test_service'), ts)
+
+ service = getService(self.folder1, 'test_service')
+ self.assertEqual(service, ts)