[Zope3-checkins] CVS: Zope3/src/zope/app/services/tests -
test_serviceregistration.py:1.1.26.2
Jim Fulton
jim at zope.com
Tue Sep 9 16:22:26 EDT 2003
Update of /cvs-repository/Zope3/src/zope/app/services/tests
In directory cvs.zope.org:/tmp/cvs-serv17585/src/zope/app/services/tests
Modified Files:
Tag: parentgeddon-branch
test_serviceregistration.py
Log Message:
got more tests to pass on branch
=== Zope3/src/zope/app/services/tests/test_serviceregistration.py 1.1.26.1 => 1.1.26.2 ===
--- Zope3/src/zope/app/services/tests/test_serviceregistration.py:1.1.26.1 Tue Sep 9 10:19:39 2003
+++ Zope3/src/zope/app/services/tests/test_serviceregistration.py Tue Sep 9 15:22:26 2003
@@ -35,7 +35,8 @@
from zope.app.interfaces.dependable import IDependable
from zope.app.interfaces.dependable import DependencyError
-
+from zope.app.container.add import add
+from zope.app.container.remove import remove
class ITestService(Interface):
pass
@@ -82,7 +83,7 @@
'++etc++site/default')
self.__default = default
- c_name = default.setObject('c', TestService())
+ c_name = add(default, 'c', TestService())
registration = ServiceRegistration(
'test_service', '/++etc++site/default/c')
@@ -90,7 +91,7 @@
self.__c = traverse(default, c_name)
self.__cm = default.getRegistrationManager()
- self.__registration_name = self.__cm.setObject('', registration)
+ self.__registration_name = add(self.__cm, 'r', registration)
self.__config = traverse(self.__cm, self.__registration_name)
self.__configpath = getPath(self.__config)
@@ -128,7 +129,7 @@
registry = sm.queryRegistrationsFor(self.__config)
self.failUnless(registry, "The components should be registered")
- del self.__cm[self.__registration_name]
+ remove(self.__cm, self.__registration_name)
self.assertEqual(self.__c._dependents, ())
u = getAdapter(self.__c, IRegistered)
self.assertEqual(len(u.usages()), 0)
@@ -138,7 +139,7 @@
def test_disallow_delete_when_active(self):
self.__config.status = ActiveStatus
try:
- del self.__cm[self.__registration_name]
+ remove(self.__cm, self.__registration_name)
except DependencyError:
pass # OK
else:
@@ -146,7 +147,7 @@
def test_not_a_local_service(self):
defineService('test_service_2', ITestService)
- self.__default.setObject('c2', TestServiceBase())
+ add(self.__default, 'c2', TestServiceBase())
self.assertRaises(
TypeError,
More information about the Zope3-Checkins
mailing list