[Zope3-checkins] CVS: Zope3/src/zope/app/services/tests - test_serviceregistration.py:1.1.26.1

Fred L. Drake, Jr. fred at zope.com
Tue Sep 9 11:19:39 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/services/tests
In directory cvs.zope.org:/tmp/cvs-serv27656

Modified Files:
      Tag: parentgeddon-branch
	test_serviceregistration.py 
Log Message:
fix 5 more tests


=== Zope3/src/zope/app/services/tests/test_serviceregistration.py 1.1 => 1.1.26.1 ===
--- Zope3/src/zope/app/services/tests/test_serviceregistration.py:1.1	Sat Jun 21 17:22:13 2003
+++ Zope3/src/zope/app/services/tests/test_serviceregistration.py	Tue Sep  9 10:19:39 2003
@@ -82,18 +82,17 @@
                            '++etc++site/default')
         self.__default = default
 
-        default.setObject('c', TestService())
-
+        c_name = default.setObject('c', TestService())
 
         registration = ServiceRegistration(
             'test_service', '/++etc++site/default/c')
 
-        self.__c = traverse(default, 'c')
+        self.__c = traverse(default, c_name)
         self.__cm = default.getRegistrationManager()
 
-        self.__cm.setObject('', registration)
+        self.__registration_name = self.__cm.setObject('', registration)
 
-        self.__config = traverse(default.getRegistrationManager(), '1')
+        self.__config = traverse(self.__cm, self.__registration_name)
         self.__configpath = getPath(self.__config)
 
     def test_activated(self):
@@ -129,7 +128,7 @@
         registry = sm.queryRegistrationsFor(self.__config)
         self.failUnless(registry, "The components should be registered")
 
-        del self.__cm['1']
+        del self.__cm[self.__registration_name]
         self.assertEqual(self.__c._dependents, ())
         u = getAdapter(self.__c, IRegistered)
         self.assertEqual(len(u.usages()), 0)
@@ -139,11 +138,11 @@
     def test_disallow_delete_when_active(self):
         self.__config.status = ActiveStatus
         try:
-            del self.__cm['1']
+            del self.__cm[self.__registration_name]
         except DependencyError:
             pass # OK
         else:
-            self.failUnless(0, "Should have gotten a depency error")
+            self.fail("Should have gotten a dependency error")
 
     def test_not_a_local_service(self):
         defineService('test_service_2', ITestService)




More information about the Zope3-Checkins mailing list