[Zope3-checkins] CVS: Zope3/src/zope/app/services/tests -
test_connectionservice.py:1.15 test_menu.py:1.3
Jim Fulton
jim at zope.com
Sun Sep 21 13:33:13 EDT 2003
Update of /cvs-repository/Zope3/src/zope/app/services/tests
In directory cvs.zope.org:/tmp/cvs-serv15156/src/zope/app/services/tests
Modified Files:
test_connectionservice.py test_menu.py
Log Message:
Use helper function to add registrations.
Changed to use __setitem__ rather than setObject
=== Zope3/src/zope/app/services/tests/test_connectionservice.py 1.14 => 1.15 ===
--- 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 Sun Sep 21 13:33:13 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_menu.py 1.2 => 1.3 ===
--- 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 Sun Sep 21 13:33:13 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.addItem(item)
return item
More information about the Zope3-Checkins
mailing list