[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/OFS/Services/ServiceManager/tests - testServiceManager.py:1.4.12.1

Jim Fulton jim@zope.com
Mon, 16 Dec 2002 16:56:33 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Services/ServiceManager/tests
In directory cvs.zope.org:/tmp/cvs-serv13751/lib/python/Zope/App/OFS/Services/ServiceManager/tests

Modified Files:
      Tag: AdapterAndView-branch
	testServiceManager.py 
Log Message:
Fixed bug in get method, which wasn't changed to reflect new
configuration framework.


=== Zope3/lib/python/Zope/App/OFS/Services/ServiceManager/tests/testServiceManager.py 1.4 => 1.4.12.1 ===
--- Zope3/lib/python/Zope/App/OFS/Services/ServiceManager/tests/testServiceManager.py:1.4	Sat Nov 30 13:39:18 2002
+++ Zope3/lib/python/Zope/App/OFS/Services/ServiceManager/tests/testServiceManager.py	Mon Dec 16 16:56:33 2002
@@ -74,6 +74,25 @@
         self.assertEqual(c(c(c(c(testOb)))), self.rootFolder)
         self.assertEqual(testOb, ts)
 
+    def test_get(self):
+        self.createServiceManager()
+        sm = traverse(self.rootFolder, '++etc++Services')
+        default = traverse(sm, 'Packages/default')
+        
+        ts = TestService()
+        default.setObject('test_service1', ts)
+        configuration = ServiceConfiguration(
+            'test_service',
+            '/++etc++Services/Packages/default/test_service1')
+
+        default['configure'].setObject('', configuration)
+        traverse(default, 'configure/1').status = Active
+
+        testOb = sm.get('test_service')
+        self.assertEqual(testOb, ts)
+        testOb = sm.get('test_service2')
+        self.assertEqual(testOb, None)
+
     def testAddService(self):
         self.createServiceManager()
         sm = traverse(self.rootFolder, '++etc++Services')