[Zope3-checkins] CVS: Zope3/src/zope/app/services/tests -
objecthubsetup.py:1.12.24.1 test_adapter.py:1.21.6.3
test_auth.py:1.18.10.1 test_cachingservice.py:1.13.6.1
test_connectionservice.py:1.14.4.1
test_eventservice.py:1.27.24.3 test_field.py:1.11.6.1
test_menu.py:1.2.6.1 test_module.py:1.10.18.1
test_modulelookup.py:1.3.18.3 test_objecthub.py:1.12.8.3
test_pagefolder.py:1.7.18.3 test_registration.py:1.1.18.1
test_registrationmanager.py:1.2.6.3 test_registrations.py:1.2.24.2
test_registrationstack.py:1.2.18.2
test_roleservice.py:1.4.24.1 test_servicemanager.py:1.15.2.3
test_serviceregistration.py:1.1.26.3 test_utility.py:1.10.8.2
test_view.py:1.22.2.3
Jim Fulton
jim at zope.com
Fri Sep 12 15:16:08 EDT 2003
Update of /cvs-repository/Zope3/src/zope/app/services/tests
In directory cvs.zope.org:/tmp/cvs-serv13470/src/zope/app/services/tests
Modified Files:
Tag: parentgeddon-branch
objecthubsetup.py test_adapter.py test_auth.py
test_cachingservice.py test_connectionservice.py
test_eventservice.py test_field.py test_menu.py test_module.py
test_modulelookup.py test_objecthub.py test_pagefolder.py
test_registration.py test_registrationmanager.py
test_registrations.py test_registrationstack.py
test_roleservice.py test_servicemanager.py
test_serviceregistration.py test_utility.py test_view.py
Log Message:
Can't have the tests passing, can we?
=== Zope3/src/zope/app/services/tests/objecthubsetup.py 1.12 => 1.12.24.1 ===
--- Zope3/src/zope/app/services/tests/objecthubsetup.py:1.12 Sat Jun 7 03:23:52 2003
+++ Zope3/src/zope/app/services/tests/objecthubsetup.py Fri Sep 12 15:15:35 2003
@@ -22,7 +22,7 @@
from zope.app.services.servicenames import HubIds
from zope.app.traversing import traverse, canonicalPath
-from zope.app.interfaces.event import IObjectAddedEvent, IObjectMovedEvent
+from zope.app.interfaces.container import IObjectAddedEvent, IObjectMovedEvent
from zope.app.interfaces.event import ISubscriber
from zope.interface import implements
@@ -81,19 +81,19 @@
# The policy is to register on object adds and object copies.
if (IObjectAddedEvent.isImplementedBy(event)
and not IObjectMovedEvent.isImplementedBy(event)):
- self.hub.register(event.location)
+ self.hub.register(event.object)
class ObjectHubSetup(EventSetup):
def setUpRegistrationSubscriber(self):
subscriber = RegistrationSubscriber(self.object_hub)
- self.rootFolder.setObject('registration_subscriber', subscriber)
+ self.rootFolder['registration_subscriber'] = subscriber
self.subscriber = traverse(self.rootFolder, 'registration_subscriber')
self.object_hub.subscribe(self.subscriber)
def setUpLoggingSubscriber(self):
subscriber = LoggingSubscriber()
- self.rootFolder.setObject('logging_subscriber', subscriber)
+ self.rootFolder['logging_subscriber'] = subscriber
self.subscriber = traverse(self.rootFolder, 'logging_subscriber')
self.object_hub.subscribe(self.subscriber)
=== Zope3/src/zope/app/services/tests/test_adapter.py 1.21.6.2 => 1.21.6.3 ===
--- Zope3/src/zope/app/services/tests/test_adapter.py:1.21.6.2 Mon Sep 8 17:15:10 2003
+++ Zope3/src/zope/app/services/tests/test_adapter.py Fri Sep 12 15:15:35 2003
@@ -135,7 +135,7 @@
registration_manager = traverse(sm, 'default').getRegistrationManager()
registration = Registration()
- name = registration_manager.setObject('', registration)
+ name = registration_manager.addRegistration(registration)
registration = traverse(registration_manager, name)
class O:
@@ -174,7 +174,7 @@
registration_manager = traverse(sm, 'default').getRegistrationManager()
registration = Registration()
registration.adapterName = u"Yatta!"
- key = registration_manager.setObject('', registration)
+ key = registration_manager.addRegistration(registration)
registration = traverse(registration_manager, key)
class O:
@@ -223,7 +223,7 @@
registration_manager = traverse(sm, 'default').getRegistrationManager()
registration = Registration()
- name = registration_manager.setObject('', registration)
+ name = registration_manager.addRegistration(registration)
registration = traverse(registration_manager, name)
class O:
=== Zope3/src/zope/app/services/tests/test_auth.py 1.18 => 1.18.10.1 ===
--- Zope3/src/zope/app/services/tests/test_auth.py:1.18 Mon Jul 28 07:45:31 2003
+++ Zope3/src/zope/app/services/tests/test_auth.py Fri Sep 12 15:15:35 2003
@@ -58,12 +58,11 @@
sm = traverse(self.rootFolder, '++etc++site')
auth = setup.addService(sm, Authentication, AuthenticationService())
- auth.setObject('srichter', User('srichter', 'Stephan', 'Richter',
- 'srichter', 'hello'))
- auth.setObject('jim', User('jim', 'Jim', 'Fulton',
- 'jim', 'hello2'))
- auth.setObject('stevea', User('stevea', 'Steve', 'Alexander',
- 'stevea', 'hello3'))
+ auth['srichter'] = User('srichter', 'Stephan', 'Richter',
+ 'srichter', 'hello')
+ auth['jim'] = User('jim', 'Jim', 'Fulton', 'jim', 'hello2')
+ auth['stevea'] = User('stevea', 'Steve', 'Alexander',
+ 'stevea', 'hello3')
self._auth = auth
=== Zope3/src/zope/app/services/tests/test_cachingservice.py 1.13 => 1.13.6.1 ===
--- Zope3/src/zope/app/services/tests/test_cachingservice.py:1.13 Tue Aug 19 13:34:28 2003
+++ Zope3/src/zope/app/services/tests/test_cachingservice.py Fri Sep 12 15:15:35 2003
@@ -64,11 +64,11 @@
if not cname:
cname = name
default = traverse(self.rootFolder, folder +'/++etc++site/default')
- key = default.setObject(cname, cache)
- cache = traverse(default, key)
+ default[cname] = cache
+ cache = traverse(default, cname)
path = "%s/%s" % (zapi.getPath(default), name)
registration = UtilityRegistration(name, ICache, path)
- key = default.getRegistrationManager().setObject("", registration)
+ key = default.getRegistrationManager().addRegistration(registration)
zapi.traverse(default.getRegistrationManager(), key).status = status
return zapi.traverse(default, name)
=== Zope3/src/zope/app/services/tests/test_connectionservice.py 1.14 => 1.14.4.1 ===
--- Zope3/src/zope/app/services/tests/test_connectionservice.py:1.14 Thu Aug 21 08:01:21 2003
+++ Zope3/src/zope/app/services/tests/test_connectionservice.py Fri Sep 12 15:15:35 2003
@@ -50,10 +50,10 @@
def addConnection(servicemanager, name, connection, status=ActiveStatus):
"""Add a menu to the service manager's default package."""
default = zapi.traverse(servicemanager, 'default')
- default.setObject(name, connection)
+ default[name] = connection
path = "%s/default/%s" % (zapi.getPath(servicemanager), name)
registration = UtilityRegistration(name, IZopeDatabaseAdapter, path)
- key = default.getRegistrationManager().setObject("", registration)
+ key = default.getRegistrationManager().addRegistration(registration)
zapi.traverse(default.getRegistrationManager(), key).status = status
return zapi.traverse(default, name)
=== Zope3/src/zope/app/services/tests/test_eventservice.py 1.27.24.2 => 1.27.24.3 ===
--- Zope3/src/zope/app/services/tests/test_eventservice.py:1.27.24.2 Mon Sep 8 17:15:10 2003
+++ Zope3/src/zope/app/services/tests/test_eventservice.py Fri Sep 12 15:15:35 2003
@@ -28,9 +28,11 @@
from zope.app.event import publish
from zope.app.event.tests.subscriber import DummySubscriber, DummyFilter
from zope.app.interfaces.event import IObjectEvent, IObjectModifiedEvent
-from zope.app.interfaces.event import IObjectRemovedEvent, IObjectAddedEvent
+from zope.app.interfaces.container import IObjectAddedEvent
+from zope.app.interfaces.container import IObjectRemovedEvent
from zope.app.interfaces.event import ISubscriber
-from zope.app.event.objectevent import ObjectAddedEvent, ObjectModifiedEvent
+from zope.app.container.contained import ObjectAddedEvent
+from zope.app.event.objectevent import ObjectModifiedEvent
from zope.app.interfaces.event import IEvent, ISubscribingAware
from zope.app.interfaces.services.registration import RegisteredStatus
from zope.app.services.tests.eventsetup import EventSetup
@@ -39,7 +41,22 @@
from zope.app.interfaces.services.service import ISimpleService
from zope.app.services.event import EventService
from zope.app.tests import setup
-from zope.app.container.add import add
+from zope.app.container.contained import Contained
+from zope.app.interfaces.traversing import IContainmentRoot
+import zope.interface
+
+class Folder(Contained):
+ pass
+
+root = Folder()
+zope.interface.directlyProvides(root, IContainmentRoot)
+foo = Folder()
+foo.__parent__ = root
+foo.__name__ = 'foo'
+
+
+
+
class UnpromotingEventService(EventService):
def isPromotableEvent(self, event):
@@ -126,11 +143,11 @@
setup.addService(sm, EventSubscription, events, suffix='s')
def _createSubscribers(self):
- self.rootFolder.setObject("rootFolderSubscriber", DummySubscriber())
+ self.rootFolder["rootFolderSubscriber"] = DummySubscriber()
self.rootFolderSubscriber = self.rootFolder["rootFolderSubscriber"]
- self.folder1.setObject("folder1Subscriber", DummySubscriber())
+ self.folder1["folder1Subscriber"] = DummySubscriber()
self.folder1Subscriber = self.folder1["folder1Subscriber"]
- self.folder1_1.setObject("folder1_1Subscriber", DummySubscriber())
+ self.folder1_1["folder1_1Subscriber"] = DummySubscriber()
self.folder1_1Subscriber = self.folder1_1["folder1_1Subscriber"]
def _createHubIdSubscribers(self):
@@ -161,7 +178,7 @@
self.assertEqual(root, getPath(self.rootFolderSubscriber))
self.assertEqual(folder1, getPath(self.folder1Subscriber))
self.assertEqual(folder1_1, getPath(self.folder1_1Subscriber))
- publish(self.folder1, ObjectAddedEvent(None, '/foo'))
+ publish(self.folder1, ObjectAddedEvent(foo))
self.assertEqual(self.rootFolderSubscriber.notified, 1)
self.assertEqual(self.folder1Subscriber.notified, 1)
self.assertEqual(self.folder1_1Subscriber.notified, 1)
@@ -174,7 +191,7 @@
unsubscribe(folder1_1Path,
event_type=IObjectAddedEvent,
context=self.folder1_1)
- publish(self.folder1, ObjectAddedEvent(None, '/foo'))
+ publish(self.folder1, ObjectAddedEvent(foo))
self.assertEqual(self.rootFolderSubscriber.notified, 1)
self.assertEqual(self.folder1Subscriber.notified, 1)
self.assertEqual(self.folder1_1Subscriber.notified, 1)
@@ -203,7 +220,7 @@
('/folder1/folder1_1/folder1_1Subscriber',
self.folder1_1Subscriber)
)
- publish(self.folder1, ObjectAddedEvent(None, '/foo'))
+ publish(self.folder1, ObjectAddedEvent(foo))
self.assertEqual(self.rootFolderSubscriber.notified, 1)
self.assertEqual(self.folder1Subscriber.notified, 1)
self.assertEqual(self.folder1_1Subscriber.notified, 1)
@@ -218,7 +235,7 @@
unsubscribe(2,
event_type=IObjectAddedEvent,
context=self.folder1_1)
- publish(self.folder1, ObjectAddedEvent(None, '/foo'))
+ publish(self.folder1, ObjectAddedEvent(None, None, 'foo'))
self.assertEqual(self.rootFolderSubscriber.notified, 1)
self.assertEqual(self.folder1Subscriber.notified, 1)
self.assertEqual(self.folder1_1Subscriber.notified, 1)
@@ -241,7 +258,7 @@
folder1Subscriber = self.folder1['folder1Subscriber']
del self.folder1['folder1Subscriber']
- publish(self.folder1, ObjectAddedEvent(None, '/foo'))
+ publish(self.folder1, ObjectAddedEvent(foo))
self.assertEqual(self.rootFolderSubscriber.notified, 1)
self.assertEqual(self.folder1Subscriber.notified, 0)
self.assertEqual(self.folder1_1Subscriber.notified, 1)
@@ -249,14 +266,14 @@
# Now, put folder1Subscriber back. This incidentally fires off a
# ObjectAddedEvent, since self.folder1 is decorated with a context
# decorator.
- add(self.folder1, 'folder1Subscriber', folder1Subscriber)
+ self.folder1['folder1Subscriber'] = folder1Subscriber
self.assertEqual(self.rootFolderSubscriber.notified, 2)
self.assertEqual(self.folder1Subscriber.notified, 0)
self.assertEqual(self.folder1_1Subscriber.notified, 2)
# folder1Subscriber should not be notified now, because it was removed
# as a bad subscriber.
- publish(self.folder1, ObjectAddedEvent(None, '/foo'))
+ publish(self.folder1, ObjectAddedEvent(foo))
self.assertEqual(self.rootFolderSubscriber.notified, 3)
self.assertEqual(self.folder1Subscriber.notified, 0)
self.assertEqual(self.folder1_1Subscriber.notified, 3)
@@ -286,7 +303,7 @@
folder1_1Path,
event_type=IObjectAddedEvent,
context=self.folder1_1))
- publish(self.folder1, ObjectAddedEvent(None, '/foo'))
+ publish(self.folder1, ObjectAddedEvent(foo))
self.assertEqual(self.rootFolderSubscriber.notified, 1)
self.assertEqual(self.folder1Subscriber.notified, 1)
self.assertEqual(self.folder1_1Subscriber.notified, 1)
@@ -300,7 +317,7 @@
unsubscribe(folder1_1Path,
event_type=IObjectAddedEvent,
context=self.folder1_1)
- publish(self.folder1, ObjectAddedEvent(None, '/foo'))
+ publish(self.folder1, ObjectAddedEvent(foo))
self.assertEqual(self.rootFolderSubscriber.notified, 1)
self.assertEqual(self.folder1Subscriber.notified, 1)
self.assertEqual(self.folder1_1Subscriber.notified, 1)
@@ -333,7 +350,7 @@
('/folder1/folder1_1/folder1_1Subscriber',
self.folder1_1Subscriber)
)
- publish(self.folder1, ObjectAddedEvent(None, '/foo'))
+ publish(self.folder1, ObjectAddedEvent(foo))
self.assertEqual(self.rootFolderSubscriber.notified, 1)
self.assertEqual(self.folder1Subscriber.notified, 1)
self.assertEqual(self.folder1_1Subscriber.notified, 1)
@@ -348,7 +365,7 @@
unsubscribe(2,
event_type=IObjectAddedEvent,
context=self.folder1_1)
- publish(self.folder1, ObjectAddedEvent(None, '/foo'))
+ publish(self.folder1, ObjectAddedEvent(foo))
self.assertEqual(self.rootFolderSubscriber.notified, 1)
self.assertEqual(self.folder1Subscriber.notified, 1)
self.assertEqual(self.folder1_1Subscriber.notified, 1)
@@ -476,7 +493,7 @@
def _testSubscribe1(self):
# Test subscribe method with one parameter
subscribe(self.rootFolderSubscriber)
- publish(self.rootFolder, ObjectAddedEvent(None, '/foo'))
+ publish(self.rootFolder, ObjectAddedEvent(foo))
self.assertEqual(self.rootFolderSubscriber.notified, 1)
def testPathSubscribe1(self):
@@ -493,7 +510,7 @@
self.rootFolderSubscriber,
event_type=IObjectAddedEvent
)
- publish(self.folder1_1_1, ObjectAddedEvent(None, '/foo'))
+ publish(self.folder1_1_1, ObjectAddedEvent(foo))
self.assertEqual(self.rootFolderSubscriber.notified, 1)
def testPathSubscribe2(self):
@@ -511,7 +528,7 @@
event_type=IObjectAddedEvent,
filter=DummyFilter()
)
- publish(self.folder1_1_1, ObjectAddedEvent(None, '/foo'))
+ publish(self.folder1_1_1, ObjectAddedEvent(foo))
self.assertEqual(self.rootFolderSubscriber.notified, 1)
def testPathSubscribe3(self):
@@ -530,7 +547,7 @@
event_type=IObjectAddedEvent,
filter=DummyFilter(0)
)
- publish(self.folder1_1_1, ObjectAddedEvent(None, '/foo'))
+ publish(self.folder1_1_1, ObjectAddedEvent(foo))
self.assertEqual(self.rootFolderSubscriber.notified, 0)
def testPathSubscribe4(self):
@@ -549,7 +566,7 @@
event_type=IObjectModifiedEvent,
filter=DummyFilter()
)
- publish(self.folder1_1_1, ObjectAddedEvent(None, '/foo'))
+ publish(self.folder1_1_1, ObjectAddedEvent(foo))
self.assertEqual(self.rootFolderSubscriber.notified, 0)
def testPathSubscribe5(self):
@@ -567,7 +584,7 @@
self.rootFolderSubscriber,
event_type=IObjectEvent
)
- publish(self.folder1_1_1, ObjectAddedEvent(None, '/foo'))
+ publish(self.folder1_1_1, ObjectAddedEvent(foo))
self.assertEqual(self.rootFolderSubscriber.notified, 1)
def testPathSubscribe6(self):
@@ -589,7 +606,7 @@
self.rootFolderSubscriber,
event_type=IObjectAddedEvent
)
- publish(self.folder1_1_1, ObjectAddedEvent(None, '/foo'))
+ publish(self.folder1_1_1, ObjectAddedEvent(foo))
self.assertEqual(self.rootFolderSubscriber.notified, 1)
def testPathSubscribe7(self):
@@ -616,7 +633,7 @@
event_type=IObjectAddedEvent,
filter=DummyFilter(0)
)
- publish(self.folder1_1_1, ObjectAddedEvent(None, '/foo'))
+ publish(self.folder1_1_1, ObjectAddedEvent(foo))
self.assertEqual(self.rootFolderSubscriber.notified, 2)
def testPathSubscribe8(self):
@@ -632,12 +649,12 @@
subscribe(
self.rootFolderSubscriber
)
- publish(self.folder1_1_1, ObjectAddedEvent(None, '/foo'))
+ publish(self.folder1_1_1, ObjectAddedEvent(foo))
self.assertEqual(self.rootFolderSubscriber.notified, 1)
unsubscribeAll(
self.rootFolderSubscriber
)
- publish(self.folder1_1_1, ObjectAddedEvent(None, '/foo'))
+ publish(self.folder1_1_1, ObjectAddedEvent(foo))
self.assertEqual(self.rootFolderSubscriber.notified, 1)
def testPathUnsubscribe1(self):
@@ -669,7 +686,7 @@
subscriber = self.rootFolderSubscriber
subscriber2 = self.folder1Subscriber
filter = DummyFilter()
- event = ObjectAddedEvent(None, '/foo')
+ event = ObjectAddedEvent(foo)
event2 = ObjectModifiedEvent(None, '/foo')
subscribe(
subscriber)
@@ -737,7 +754,7 @@
subscriber = self.rootFolderSubscriber
subscribe(subscriber)
self.assertEqual(subscriber.notified, 0)
- publish(self.folder1_1_1, ObjectAddedEvent(None, '/foo'))
+ publish(self.folder1_1_1, ObjectAddedEvent(foo))
self.assertEqual(subscriber.notified, 1)
def testPathPublish1(self):
@@ -761,7 +778,7 @@
subscriber,
event_type=IObjectAddedEvent,
)
- publish(self.folder1_1_1, ObjectAddedEvent(None, '/foo'))
+ publish(self.folder1_1_1, ObjectAddedEvent(foo))
self.assertEqual(subscriber.notified, 2)
def testPathPublish2(self):
@@ -819,7 +836,7 @@
self._testpublish4()
def _createAlternateService(self, service):
- self.folder2.setObject("folder2Subscriber", DummySubscriber())
+ self.folder2["folder2Subscriber"] = DummySubscriber()
self.folder2Subscriber = self.folder2["folder2Subscriber"]
sm = self.makeSite('folder2')
@@ -840,7 +857,7 @@
# with the appropriate isPromotableEvent setting
self._createHubIdSubscribers()
self._createAlternateService(UnpromotingEventService())
- publish(self.folder2, ObjectAddedEvent(None, '/foo'))
+ publish(self.folder2, ObjectAddedEvent(foo))
self.assertEqual(self.folder2Subscriber.notified, 1)
self.assertEqual(self.rootFolderSubscriber.notified, 0)
@@ -849,7 +866,7 @@
# the appropriate isPromotableEvent setting
self._createHubIdSubscribers()
self._createAlternateService(EventService())
- publish(self.folder2, ObjectAddedEvent(None, '/foo'))
+ publish(self.folder2, ObjectAddedEvent(foo))
self.assertEqual(self.folder2Subscriber.notified, 1)
self.assertEqual(self.rootFolderSubscriber.notified, 1)
@@ -874,14 +891,14 @@
sm = traverse(self.rootFolder, "folder1/++etc++site")
registration = sm.queryRegistrations(EventPublication).active()
registration.status = RegisteredStatus
- publish(self.rootFolder, ObjectAddedEvent(None, '/foo'))
+ publish(self.rootFolder, ObjectAddedEvent(foo))
self.assertEqual(self.folder1Subscriber.notified, 1)
self.assertEqual(self.folder1_1Subscriber.notified, 1)
registration = sm.queryRegistrations(EventSubscription).active()
registration.status = RegisteredStatus
- publish(self.rootFolder, ObjectAddedEvent(None, '/foo'))
+ publish(self.rootFolder, ObjectAddedEvent(foo))
self.assertEqual(self.folder1Subscriber.notified, 1)
self.assertEqual(self.folder1_1Subscriber.notified, 2)
@@ -891,7 +908,7 @@
sv.subscribeOnBind = 0
self._createHubIdSubscribers()
self._createAlternateService(sv)
- publish(self.rootFolder, ObjectAddedEvent(None, '/foo'))
+ publish(self.rootFolder, ObjectAddedEvent(foo))
self.assertEqual(self.folder2Subscriber.notified, 0)
self.assertEqual(self.rootFolderSubscriber.notified, 1)
@@ -908,9 +925,7 @@
provideAdapter(IHasSubscribingAwareAdapter,
ISubscribingAware,
adapter)
- self.rootFolder.setObject(
- "mySubscriber",
- HasSubscribingAwareAdapter())
+ self.rootFolder["mySubscriber"] = HasSubscribingAwareAdapter()
self.mySubscriber = self.rootFolder["mySubscriber"]
filter = DummyFilter()
subscribe(
=== Zope3/src/zope/app/services/tests/test_field.py 1.11 => 1.11.6.1 ===
--- Zope3/src/zope/app/services/tests/test_field.py:1.11 Sun Aug 17 02:08:20 2003
+++ Zope3/src/zope/app/services/tests/test_field.py Fri Sep 12 15:15:35 2003
@@ -39,8 +39,8 @@
def createObjects(self):
self.buildFolders()
- self.folder1.setObject('c', C())
- self.folder1.setObject('d', D())
+ self.folder1['c'] = C()
+ self.folder1['d'] = D()
def createFields(self):
from zope.app.services.field import ComponentPath
=== Zope3/src/zope/app/services/tests/test_menu.py 1.2 => 1.2.6.1 ===
--- Zope3/src/zope/app/services/tests/test_menu.py:1.2 Fri Aug 15 20:44:14 2003
+++ Zope3/src/zope/app/services/tests/test_menu.py Fri Sep 12 15:15:35 2003
@@ -66,10 +66,10 @@
menu.usage = usage
default = zapi.traverse(servicemanager, 'default')
- default.setObject(menu_id, menu)
+ default[menu_id] = menu
path = "%s/default/%s" % (zapi.getPath(servicemanager), menu_id)
registration = UtilityRegistration(menu_id, ILocalBrowserMenu, path)
- key = default.getRegistrationManager().setObject("", registration)
+ key = default.getRegistrationManager().addRegistration(registration)
zapi.traverse(default.getRegistrationManager(), key).status = ActiveStatus
return zapi.traverse(default, menu_id)
@@ -79,7 +79,7 @@
item.title = title
item.action = action
item.interface = interface
- menu.setObject('something', item)
+ menu['something'] = item
return item
=== Zope3/src/zope/app/services/tests/test_module.py 1.10 => 1.10.18.1 ===
--- Zope3/src/zope/app/services/tests/test_module.py:1.10 Mon Jun 30 12:25:23 2003
+++ Zope3/src/zope/app/services/tests/test_module.py Fri Sep 12 15:15:35 2003
@@ -58,7 +58,7 @@
self.sm = traverse(self.rootFolder, "++etc++site")
default = traverse(self.sm, "default")
old_called = called
- default.setObject(NAME, Manager(NAME, SOURCE))
+ default[NAME] = Manager(NAME, SOURCE)
self.manager = traverse(default, NAME)
self.assertEqual(called, old_called)
self.manager.execute()
=== Zope3/src/zope/app/services/tests/test_modulelookup.py 1.3.18.2 => 1.3.18.3 ===
--- Zope3/src/zope/app/services/tests/test_modulelookup.py:1.3.18.2 Mon Sep 8 17:15:10 2003
+++ Zope3/src/zope/app/services/tests/test_modulelookup.py Fri Sep 12 15:15:35 2003
@@ -37,8 +37,9 @@
return self.module
class MyFolder(RegistrationManagerContainer, dict, Contained):
- def setObject(self, name, object):
- self[name] = contained(object, self, name)
+ def __setitem__(self, name, object):
+ object = contained(object, self, name)
+ dict.__setitem__(self, name, object)
return name
=== Zope3/src/zope/app/services/tests/test_objecthub.py 1.12.8.2 => 1.12.8.3 ===
--- Zope3/src/zope/app/services/tests/test_objecthub.py:1.12.8.2 Mon Sep 8 17:15:10 2003
+++ Zope3/src/zope/app/services/tests/test_objecthub.py Fri Sep 12 15:15:35 2003
@@ -20,30 +20,34 @@
import unittest
from zope.app.services.tests.objecthubsetup import ObjectHubSetup
-from zope.app.interfaces.event\
- import IObjectAddedEvent, IObjectRemovedEvent, IObjectModifiedEvent,\
- IObjectMovedEvent
-from zope.app.event.objectevent\
- import ObjectAddedEvent, ObjectModifiedEvent, ObjectRemovedEvent,\
- ObjectMovedEvent, ObjectCreatedEvent
+from zope.app.interfaces.event import IObjectModifiedEvent
+from zope.app.interfaces.container import IObjectAddedEvent
+from zope.app.interfaces.container import IObjectRemovedEvent
+from zope.app.interfaces.container import IObjectAddedEvent
+
+from zope.app.container.contained import ObjectAddedEvent, ObjectRemovedEvent
+from zope.app.container.contained import ObjectMovedEvent
+from zope.app.event.objectevent import ObjectModifiedEvent, ObjectCreatedEvent
+
from zope.app.interfaces.services.hub import ObjectHubError
-from zope.app.interfaces.services.hub import \
- IObjectRemovedHubEvent, IObjectModifiedHubEvent, \
- IObjectMovedHubEvent, IObjectRegisteredHubEvent, \
- IObjectUnregisteredHubEvent
-
-from zope.app.services.hub \
- import ObjectModifiedHubEvent, ObjectRemovedHubEvent, \
- ObjectMovedHubEvent, ObjectRegisteredHubEvent, \
- ObjectUnregisteredHubEvent
+from zope.app.interfaces.services.hub import IObjectRemovedHubEvent
+from zope.app.interfaces.services.hub import IObjectModifiedHubEvent
+from zope.app.interfaces.services.hub import IObjectMovedHubEvent
+from zope.app.interfaces.services.hub import IObjectRegisteredHubEvent
+from zope.app.interfaces.services.hub import IObjectUnregisteredHubEvent
+
+from zope.app.services.hub import ObjectModifiedHubEvent, ObjectRemovedHubEvent
+from zope.app.services.hub import ObjectMovedHubEvent, ObjectRegisteredHubEvent
+from zope.app.services.hub import ObjectUnregisteredHubEvent
+
+from zope.app.interfaces.traversing import IContainmentRoot
+from zope.app.location import Location
from zope.exceptions import NotFoundError
from zope.app.traversing import canonicalPath, traverse
-from zope.interface import implements
-
-from zope.app.container.add import add
+from zope.interface import implements, directlyProvides
from zope.app.container.contained import Contained
@@ -106,10 +110,22 @@
interface = IObjectUnregisteredHubEvent
klass = ObjectUnregisteredHubEvent
+class Folder(Location):
+ pass
+
class BasicHubTest(ObjectHubSetup, unittest.TestCase):
- location = '/foo/bar'
- obj = object()
- new_location = '/baz/spoo'
+ root = Folder()
+ directlyProvides(root, IContainmentRoot)
+ oldParent = Folder()
+ oldParent.__parent__ = root
+ oldParent.__name__ = 'foo'
+ newParent = Folder()
+ newParent.__parent__ = root
+ newParent.__name__ = 'baz'
+ obj = Folder()
+ obj.__parent__ = oldParent
+ obj.__name__ = 'bar'
+
def setUp(self):
ObjectHubSetup.setUp(self)
@@ -118,14 +134,16 @@
def setEvents(self):
self.created_event = ObjectCreatedEvent(object())
- self.added_event = ObjectAddedEvent(self.obj, self.location)
+ self.added_event = ObjectAddedEvent(self.obj)
self.added_new_location_event = ObjectAddedEvent(
- self.obj, self.new_location)
- self.removed_event = ObjectRemovedEvent(self.obj, self.location)
- self.modified_event = ObjectModifiedEvent(self.obj, self.location)
- self.moved_event = ObjectMovedEvent(self.obj,
- self.location,
- self.new_location)
+ self.obj, self.newParent, self.newName)
+ self.removed_event = ObjectRemovedEvent(self.obj)
+ self.modified_event = ObjectModifiedEvent(self.obj)
+ self.moved_event = ObjectMovedEvent(
+ self.obj,
+ self.oldParent, self.oldName,
+ self.newParent, self.newName,
+ )
class TestRegistrationEvents(BasicHubTest):
def testRegistration(self):
@@ -549,10 +567,10 @@
def setUp(self):
ObjectHubSetup.setUp(self)
- add(self.rootFolder, 'deleted', Contained())
+ self.rootFolder['deleted'] = Contained()
self.deleted_obj = self.rootFolder['deleted']
self.deleted_path = '/deleted'
- add(self.rootFolder, 'valid', Contained())
+ self.rootFolder['valid'] = Contained()
self.valid_obj = self.rootFolder['valid']
self.valid_path = '/valid'
=== Zope3/src/zope/app/services/tests/test_pagefolder.py 1.7.18.2 => 1.7.18.3 ===
--- Zope3/src/zope/app/services/tests/test_pagefolder.py:1.7.18.2 Mon Sep 8 17:56:39 2003
+++ Zope3/src/zope/app/services/tests/test_pagefolder.py Fri Sep 12 15:15:35 2003
@@ -43,7 +43,7 @@
sm = PlacefulSetup.setUp(self, site=True)
setup.addService(sm, 'Views', ViewService(), suffix='service')
default = traverse(self.rootFolder, '++etc++site/default')
- name = default.setObject('Views', PageFolder())
+ name = default['Views'] = PageFolder()
views = traverse(default, name)
views.forInterface = I
views.factoryName = None
@@ -51,11 +51,11 @@
self.__views = views
- def test_setObject(self):
+ def test___setitem__(self):
views = self.__views
- views.setObject('foo.html', ZPTTemplate())
+ views['foo.html'] = ZPTTemplate()
rm = views.getRegistrationManager()
name = rm.keys()[-1]
@@ -70,13 +70,13 @@
self.assertEqual(registration.attribute, None)
self.assertRaises(TypeError,
- views.setObject, 'bar.html', PageFolder())
+ views.__setitem__, 'bar.html', PageFolder())
def test_applyDefaults(self):
views = self.__views
- views.setObject('foo.html', ZPTTemplate())
+ views['foo.html'] = ZPTTemplate()
rm = views.getRegistrationManager()
name = rm.keys()[-1]
=== Zope3/src/zope/app/services/tests/test_registration.py 1.1 => 1.1.18.1 ===
--- Zope3/src/zope/app/services/tests/test_registration.py:1.1 Fri Jul 11 01:50:50 2003
+++ Zope3/src/zope/app/services/tests/test_registration.py Fri Sep 12 15:15:35 2003
@@ -19,7 +19,7 @@
from zope.app.services.hub import Registration
from zope.app.services.tests.placefulsetup import PlacefulSetup
from zope.app.traversing import traverse, canonicalPath
-from zope.app.event.objectevent import ObjectAddedEvent
+from zope.app.container.contained import ObjectAddedEvent
from zope.component import getService
from zope.app.services.servicenames import EventPublication, HubIds
@@ -29,7 +29,7 @@
self.createStandardServices()
r = Registration()
default = traverse(self.rootFolder, '++etc++site/default')
- default.setObject('registrar', r)
+ default['registrar'] = r
self.registrar = traverse(default, 'registrar')
self.hub = getService(self.rootFolder, HubIds)
self.events = getService(self.rootFolder, EventPublication)
@@ -50,7 +50,7 @@
content = object()
name = 'blah'
- event = ObjectAddedEvent(content, canonicalPath('/%s' % name))
+ event = ObjectAddedEvent(content, None, canonicalPath('/%s' % name))
self.events.publish(event)
self.assertEqual(self.hub.numRegistrations(), 1)
=== Zope3/src/zope/app/services/tests/test_registrationmanager.py 1.2.6.2 => 1.2.6.3 ===
--- Zope3/src/zope/app/services/tests/test_registrationmanager.py:1.2.6.2 Tue Sep 9 13:02:46 2003
+++ Zope3/src/zope/app/services/tests/test_registrationmanager.py Fri Sep 12 15:15:35 2003
@@ -16,7 +16,7 @@
"""
from unittest import TestCase, main, makeSuite
-from zope.app.interfaces.container import IDeleteNotifiable
+from zope.app.interfaces.container import IRemoveNotifiable
from zope.app.interfaces.services.registration import IRegistrationManager
from zope.app.services.registration import RegistrationManager
from zope.app.services.tests import placefulsetup
@@ -28,9 +28,9 @@
class Undeletable:
- implements(IDeleteNotifiable)
+ implements(IRemoveNotifiable)
- def beforeDeleteHook(self, object, container):
+ def removeNotify(self, event):
self.was_called = 1
@@ -43,7 +43,7 @@
self.names = []
self.stateDict = {}
for ltr in 'abcdefghijklmnop':
- name = manager.setObject('', ltr)
+ name = manager.addRegistration(ltr)
self.names.append(name)
self.stateDict[name] = ltr
n = self.names.pop(9); del manager[n]; del self.stateDict[n] # 'str10'
@@ -54,17 +54,17 @@
def _IEnumerableMapping__stateDict(self):
# Hook needed by BaseTestIEnumerableMapping
- # also, effectively test setObject and __delitem__.
+ # also, effectively test __setitem__ and __delitem__.
return self.stateDict
def _IEnumerableMapping__sample(self):
# Hook needed by BaseTestIEnumerableMapping
- # also, effectively test setObject and __delitem__.
+ # also, effectively test __setitem__ and __delitem__.
return self.__manager
def _IEnumerableMapping__absentKeys(self):
# Hook needed by BaseTestIEnumerableMapping
- # also, effectively test setObject and __delitem__.
+ # also, effectively test __setitem__ and __delitem__.
return ['-1', '8', '10', '17', '100', '10000']
#########################################################
@@ -135,7 +135,7 @@
def test_moveTop_one_element_container(self):
manager = RegistrationManager()
- name = manager.setObject('', 'a')
+ name = manager.addRegistration('a')
manager.moveTop([name])
self.assertEqual(list(manager.items()), [(name, 'a')])
@@ -207,7 +207,7 @@
def test_moveBottom_one_element_container(self):
manager = RegistrationManager()
- name = manager.setObject('', 'a')
+ name = manager.addRegistration('a')
manager.moveBottom([name])
self.assertEqual(list(manager.items()), [(name, 'a')])
@@ -275,7 +275,7 @@
def test_moveUp_one_element_container(self):
manager = RegistrationManager()
- name = manager.setObject('', 'a')
+ name = manager.addRegistration('a')
manager.moveUp([name])
self.assertEqual(list(manager.items()), [(name, 'a')])
@@ -344,18 +344,17 @@
def test_moveDown_one_element_container(self):
manager = RegistrationManager()
- name = manager.setObject('', 'a')
+ name = manager.addRegistration('a')
manager.moveDown([name])
self.assertEqual(list(manager.items()), [(name, 'a')])
#########################################################
- def test_manageBeforeDelete(self):
+ def test_removeNotify(self):
container = []
manager = RegistrationManager()
thingy = Undeletable()
- manager.setObject('xyzzy', thingy)
- manager.beforeDeleteHook(manager, container)
+ manager['xyzzy'] = thingy
self.failUnless(thingy.was_called)
class RegistrationManagerContainerTests(placefulsetup.PlacefulSetup):
@@ -365,10 +364,10 @@
default = traverse(sm, 'default')
self.assertEqual(default.getRegistrationManager(),
default['RegistrationManager'])
- name = default.setObject('xxx', RegistrationManager())
+ default['xxx'] = RegistrationManager()
del default['RegistrationManager']
self.assertEqual(default.getRegistrationManager(),
- default[name])
+ default['xxx'])
# Can't test empty because there's no way to make it empty.
@@ -381,7 +380,7 @@
default = traverse(sm, 'default')
self.assertRaises(Exception,
default.__delitem__, 'registration')
- default.setObject('xxx', RegistrationManager())
+ default['xxx'] = RegistrationManager()
del default['RegistrationManager']
=== Zope3/src/zope/app/services/tests/test_registrations.py 1.2.24.1 => 1.2.24.2 ===
--- Zope3/src/zope/app/services/tests/test_registrations.py:1.2.24.1 Mon Sep 8 14:21:49 2003
+++ Zope3/src/zope/app/services/tests/test_registrations.py Fri Sep 12 15:15:35 2003
@@ -29,7 +29,7 @@
from zope.app.interfaces.dependable import IDependable
from zope.app.traversing import traverse
from zope.security.proxy import Proxy
-
+from zope.app.container.contained import ObjectRemovedEvent
class ITestComponent(Interface):
pass
@@ -68,19 +68,18 @@
# Restore the status prop
SimpleRegistration.status = self.__oldprop
- def test_beforeDeleteHook(self):
- container = object()
+ def test_removeNotify(self):
cfg = SimpleRegistration()
# cannot delete an active registration
cfg.status = ActiveStatus
- self.assertRaises(DependencyError, cfg.beforeDeleteHook, cfg,
- container)
+ event = ObjectRemovedEvent(cfg, None, 'somename')
+ self.assertRaises(DependencyError, cfg.removeNotify, event)
# deletion of a registered registration causes it to become
# unregistered
cfg.status = RegisteredStatus
- cfg.beforeDeleteHook(cfg, container)
+ cfg.removeNotify(event)
self.assertEquals(cfg.status, UnregisteredStatus)
@@ -94,7 +93,7 @@
def test_getComponent(self):
# set up a component
name, component = 'foo', object()
- self.rootFolder.setObject(name, component)
+ self.rootFolder[name] = component
# set up a registration
cfg = ComponentRegistration("/"+name)
cfg.__parent__ = self.rootFolder
@@ -104,7 +103,7 @@
def test_getComponent_permission(self):
# set up a component
name, component = 'foo', object()
- self.rootFolder.setObject(name, component)
+ self.rootFolder[name] = component
# set up a registration
cfg = ComponentRegistration("/"+name, 'zope.TopSecret')
cfg.getInterface = lambda: ITestComponent
@@ -114,31 +113,30 @@
self.assertEquals(result, component)
self.failUnless(type(result) is Proxy)
- def test_afterAddHook(self):
+ def test_addNotify(self):
# set up a component
name, component = 'foo', ComponentStub()
- self.rootFolder.setObject(name, component)
+ self.rootFolder[name] = component
# set up a registration
cfg = ComponentRegistration("/"+name)
- self.rootFolder.setObject('cfg', cfg)
+ self.rootFolder['cfg'] = cfg
cfg = traverse(self.rootFolder, 'cfg')
- # simulate IAddNotifiable
- cfg.afterAddHook(cfg, self.rootFolder)
# check that the dependency tracking works
self.assertEquals(component.dependents(), ('/cfg',))
- def test_beforeDeleteHook_dependents(self):
+ def test_removeNotify_dependents(self):
# set up a component
name, component = 'foo', ComponentStub()
- self.rootFolder.setObject(name, component)
+ self.rootFolder[name] = component
component.addDependent('/cfg')
# set up a registration
cfg = ComponentRegistration("/"+name)
cfg.status = UnregisteredStatus
- self.rootFolder.setObject('cfg', cfg)
+ self.rootFolder['cfg'] = cfg
cfg = traverse(self.rootFolder, 'cfg')
- # simulate IDeleteNotifiable
- cfg.beforeDeleteHook(cfg, self.rootFolder)
+ # simulate IRemoveNotifiable
+ event = ObjectRemovedEvent(cfg, self.rootFolder, 'cfg')
+ cfg.removeNotify(event)
# check that the dependency tracking works
self.assertEquals(component.dependents(), ())
=== Zope3/src/zope/app/services/tests/test_registrationstack.py 1.2.18.1 => 1.2.18.2 ===
--- Zope3/src/zope/app/services/tests/test_registrationstack.py:1.2.18.1 Mon Sep 8 14:21:49 2003
+++ Zope3/src/zope/app/services/tests/test_registrationstack.py Fri Sep 12 15:15:35 2003
@@ -43,7 +43,7 @@
self.__registry = RegistrationStack(root)
def __config(self, name):
- self.__default.setObject(name, Registration())
+ self.__default[name] = Registration()
return self.__default[name]
def test_register_and_registered_and_nonzero_and_active(self):
=== Zope3/src/zope/app/services/tests/test_roleservice.py 1.4 => 1.4.24.1 ===
--- Zope3/src/zope/app/services/tests/test_roleservice.py:1.4 Tue Jun 3 18:46:22 2003
+++ Zope3/src/zope/app/services/tests/test_roleservice.py Fri Sep 12 15:15:35 2003
@@ -46,7 +46,7 @@
self.roleRegistry.defineRole('Manager', 'Manager', '')
r = Role("Hacker","","")
- self.rs.setObject("Hacker", r)
+ self.rs["Hacker"] = r
self.assertEqual(self.rs.getRole('Hacker').getId(), 'Hacker')
self.assertEqual(self.rs.getRole('Manager').getId(), 'Manager')
@@ -59,13 +59,13 @@
self.roleRegistry.defineRole('Manager', 'Manager', '')
r = Role("Hacker","","")
- self.rs.setObject("Hacker", r)
+ self.rs["Hacker"] = r
sm1 = self.makeSite('folder1')
rs1 = setup.addService(sm1, 'Roles', RoleService())
r1 = Role("Reviewer",'','')
- rs1.setObject("Reviewer", r1)
+ rs1["Reviewer"] = r1
self.assertEqual(rs1.getRole('Hacker').getId(), 'Hacker')
self.assertEqual(rs1.getRole('Manager').getId(), 'Manager')
=== Zope3/src/zope/app/services/tests/test_servicemanager.py 1.15.2.2 => 1.15.2.3 ===
--- Zope3/src/zope/app/services/tests/test_servicemanager.py:1.15.2.2 Tue Sep 9 10:48:28 2003
+++ Zope3/src/zope/app/services/tests/test_servicemanager.py Fri Sep 12 15:15:35 2003
@@ -47,13 +47,13 @@
default = traverse(sm, 'default')
ts = TestService()
- default.setObject('test_service1', ts)
+ default['test_service1'] = ts
registration = ServiceRegistration(
'test_service',
'/++etc++site/default/test_service1')
rm = default.getRegistrationManager()
- name = rm.setObject('', registration)
+ name = rm.addRegistration(registration)
traverse(rm, name).status = ActiveStatus
testOb = getService(self.rootFolder, 'test_service')
@@ -76,12 +76,12 @@
# Test found local
default = traverse(sm, 'default')
ts = TestService()
- default.setObject('test_service1', ts)
+ default['test_service1'] = ts
registration = ServiceRegistration(
'test_service',
'/++etc++site/default/test_service1')
rm = default.getRegistrationManager()
- name = rm.setObject('', registration)
+ name = rm.addRegistration(registration)
traverse(rm, name).status = ActiveStatus
testOb = sm.queryLocalService('test_service')
@@ -101,20 +101,20 @@
default = traverse(sm, 'default')
ts1 = TestService()
- default.setObject('test_service1', ts1)
+ default['test_service1'] = ts1
registration = ServiceRegistration(
'test_service',
'/++etc++site/default/test_service1')
rm = default.getRegistrationManager()
- name = rm.setObject('', registration)
+ name = rm.addRegistration(registration)
traverse(rm, name).status = ActiveStatus
ts2 = TestService()
- default.setObject('test_service2', ts2)
+ default['test_service2'] = ts2
registration = ServiceRegistration(
'test_service',
'/++etc++site/default/test_service2')
- name = rm.setObject('', registration)
+ name = rm.addRegistration(registration)
traverse(rm, name).status = RegisteredStatus
testOb = getService(self.rootFolder, 'test_service')
@@ -173,20 +173,19 @@
sm = self.makeSite()
default = contained(sm['default'], self.rootFolder, name='default')
- default.setObject('m1', Manager('zope.app.services.tests.sample1',
- 'x = "root m1"\n'))
+ default['m1'] = Manager('zope.app.services.tests.sample1',
+ 'x = "root m1"\n')
manager = contained(default['m1'], default, name='m1')
manager.execute()
- default.setObject('m2', Manager('XXX.ZZZ',
- 'x = "root m2"\nZZZ = 42\n'))
+ default['m2'] = Manager('XXX.ZZZ', 'x = "root m2"\nZZZ = 42\n')
manager = contained(default['m2'], default, name='m2')
manager.execute()
self.folder1.setSiteManager(ServiceManager())
sm2=getServiceManager(self.folder1)
default = contained(sm2['default'], self.folder1, name='default')
- default.setObject('m1', Manager('zope.app.services.tests.sample1',
- 'x = "folder1 m1 1"'))
+ default['m1'] = Manager('zope.app.services.tests.sample1',
+ 'x = "folder1 m1 1"')
manager = contained(default['m1'], default, name='m1')
manager.execute()
=== Zope3/src/zope/app/services/tests/test_serviceregistration.py 1.1.26.2 => 1.1.26.3 ===
--- Zope3/src/zope/app/services/tests/test_serviceregistration.py:1.1.26.2 Tue Sep 9 15:22:26 2003
+++ Zope3/src/zope/app/services/tests/test_serviceregistration.py Fri Sep 12 15:15:35 2003
@@ -35,8 +35,6 @@
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
@@ -83,15 +81,15 @@
'++etc++site/default')
self.__default = default
- c_name = add(default, 'c', TestService())
+ default['c'] = TestService()
registration = ServiceRegistration(
'test_service', '/++etc++site/default/c')
- self.__c = traverse(default, c_name)
+ self.__c = traverse(default, 'c')
self.__cm = default.getRegistrationManager()
- self.__registration_name = add(self.__cm, 'r', registration)
+ self.__registration_name = self.__cm.addRegistration(registration)
self.__config = traverse(self.__cm, self.__registration_name)
self.__configpath = getPath(self.__config)
@@ -115,21 +113,21 @@
def test_getComponent(self):
self.assertEqual(self.__config.getComponent(), self.__c)
- def test_afterAddHook(self):
+ def test_addNotify(self):
self.assertEqual(self.__c._dependents,
(self.__configpath, ))
u = getAdapter(self.__c, IRegistered)
self.assertEqual(list(u.usages()),
[self.__configpath])
- def test_beforeDeleteHook_and_unregistered(self):
+ def test_removeNotify_and_unregistered(self):
self.__config.status = RegisteredStatus
sm = getServiceManager(self.__default)
registry = sm.queryRegistrationsFor(self.__config)
self.failUnless(registry, "The components should be registered")
- remove(self.__cm, self.__registration_name)
+ del self.__cm[self.__registration_name]
self.assertEqual(self.__c._dependents, ())
u = getAdapter(self.__c, IRegistered)
self.assertEqual(len(u.usages()), 0)
@@ -139,7 +137,7 @@
def test_disallow_delete_when_active(self):
self.__config.status = ActiveStatus
try:
- remove(self.__cm, self.__registration_name)
+ del self.__cm[self.__registration_name]
except DependencyError:
pass # OK
else:
=== Zope3/src/zope/app/services/tests/test_utility.py 1.10.8.1 => 1.10.8.2 ===
--- Zope3/src/zope/app/services/tests/test_utility.py:1.10.8.1 Mon Sep 8 14:21:49 2003
+++ Zope3/src/zope/app/services/tests/test_utility.py Fri Sep 12 15:15:35 2003
@@ -140,7 +140,7 @@
def test_registrationsFor_methods(self):
utilities = getService(self.rootFolder, "Utilities")
default = traverse(self.rootFolder, "++etc++site/default")
- default.setObject('foo', Foo("local"))
+ default['foo'] = Foo("local")
path = "/++etc++site/default/foo"
for name in ('', 'bob'):
@@ -160,13 +160,13 @@
utilities = getService(self.rootFolder, "Utilities")
default = traverse(self.rootFolder, "++etc++site/default")
- default.setObject('foo', Foo("local"))
+ default['foo'] = Foo("local")
path = "/++etc++site/default/foo"
cm = default.getRegistrationManager()
for name in ('', 'bob'):
registration = utility.UtilityRegistration(name, IFoo, path)
- cname = cm.setObject('', registration)
+ cname = cm.addRegistration(registration)
registration = traverse(cm, cname)
gout = name and "foo global "+name or "foo global"
=== Zope3/src/zope/app/services/tests/test_view.py 1.22.2.2 => 1.22.2.3 ===
--- Zope3/src/zope/app/services/tests/test_view.py:1.22.2.2 Tue Sep 9 10:05:53 2003
+++ Zope3/src/zope/app/services/tests/test_view.py Fri Sep 12 15:15:35 2003
@@ -131,7 +131,7 @@
sm = traverse(self.rootFolder, '++etc++site')
registration_manager = traverse(sm, 'default').getRegistrationManager()
- key = registration_manager.setObject('', Registration())
+ key = registration_manager.addRegistration(Registration())
registration = traverse(registration_manager, key)
class O:
@@ -162,7 +162,7 @@
sm = self.buildFolders(site=True)
registration_manager = traverse(sm, 'default').getRegistrationManager()
registration = Registration()
- name = registration_manager.setObject('', registration)
+ name = registration_manager.addRegistration(registration)
registration = traverse(registration_manager, name)
class O:
@@ -238,7 +238,7 @@
self.rootFolder.setSiteManager(PhonyServiceManager())
default = traverse(self.rootFolder, '++etc++site/default')
self.__template = PhonyTemplate()
- default.setObject('t', self.__template)
+ default['t'] = self.__template
self.folder = contained(ModuleFinder(), self.rootFolder)
self.folder = contained(ModuleFinder(), self.folder)
More information about the Zope3-Checkins
mailing list