[Zope3-checkins] CVS: Zope3/src/zope/app/tests - setup.py:1.6.2.3
test_rename.py:1.1.2.3
Jim Fulton
jim at zope.com
Fri Sep 12 15:16:07 EDT 2003
Update of /cvs-repository/Zope3/src/zope/app/tests
In directory cvs.zope.org:/tmp/cvs-serv13470/src/zope/app/tests
Modified Files:
Tag: parentgeddon-branch
setup.py test_rename.py
Log Message:
Can't have the tests passing, can we?
=== Zope3/src/zope/app/tests/setup.py 1.6.2.2 => 1.6.2.3 ===
--- Zope3/src/zope/app/tests/setup.py:1.6.2.2 Mon Sep 8 17:15:11 2003
+++ Zope3/src/zope/app/tests/setup.py Fri Sep 12 15:15:37 2003
@@ -105,7 +105,7 @@
from zope.app.content.folder import Folder, RootFolder
-from zope.app.container.add import add
+
def buildSampleFolderTree():
# set up a reasonably complex folder structure
#
@@ -118,15 +118,15 @@
# folder1_1_1 folder1_1_2 folder1_2_1 folder2_1_1
root = RootFolder()
- add(root, 'folder1', Folder())
- add(root['folder1'], 'folder1_1', Folder())
- add(root['folder1']['folder1_1'], 'folder1_1_1', Folder())
- add(root['folder1']['folder1_1'], 'folder1_1_2', Folder())
- add(root['folder1'], 'folder1_2', Folder())
- add(root['folder1']['folder1_2'], 'folder1_2_1', Folder())
- add(root, 'folder2', Folder())
- add(root['folder2'], 'folder2_1', Folder())
- add(root['folder2']['folder2_1'], 'folder2_1_1', Folder())
+ root['folder1'] = Folder()
+ root['folder1']['folder1_1'] = Folder()
+ root['folder1']['folder1_1']['folder1_1_1'] = Folder()
+ root['folder1']['folder1_1']['folder1_1_2'] = Folder()
+ root['folder1']['folder1_2'] = Folder()
+ root['folder1']['folder1_2']['folder1_2_1'] = Folder()
+ root['folder2'] = Folder()
+ root['folder2']['folder2_1'] = Folder()
+ root['folder2']['folder2_1']['folder2_1_1'] = Folder()
return root
@@ -142,21 +142,16 @@
from zope.app.services.service import ServiceRegistration
from zope.app.interfaces.services.registration import ActiveStatus
-from zope.app.interfaces.container import INameChooser
-def addRegistration(rm, reg):
- name = zapi.getAdapter(rm, INameChooser).chooseName("", reg)
- return add(rm, name, reg)
-
def addService(servicemanager, name, service, suffix=''):
"""Add a service to a service manager
This utility is useful for tests that need to set up services.
"""
default = zapi.traverse(servicemanager, 'default')
- add(default, name+suffix, service)
+ default[name+suffix] = service
path = "%s/default/%s" % (zapi.getPath(servicemanager), name+suffix)
registration = ServiceRegistration(name, path, default)
- key = addRegistration(default.getRegistrationManager(), registration)
+ key = default.getRegistrationManager().addRegistration(registration)
zapi.traverse(default.getRegistrationManager(), key).status = ActiveStatus
return zapi.traverse(servicemanager, path)
=== Zope3/src/zope/app/tests/test_rename.py 1.1.2.2 => 1.1.2.3 ===
--- Zope3/src/zope/app/tests/test_rename.py:1.1.2.2 Tue Sep 9 14:08:19 2003
+++ Zope3/src/zope/app/tests/test_rename.py Fri Sep 12 15:15:37 2003
@@ -24,12 +24,6 @@
from zope.component.adapter import provideAdapter
from zope.app.interfaces.copypastemove import IObjectMover
from zope.app.interfaces.container import IContainer
-from zope.app.interfaces.container import IPasteTarget
-from zope.app.interfaces.container import IMoveSource
-from zope.app.interfaces.container import IPasteNamesChooser
-from zope.app.container.copypastemove import PasteTarget
-from zope.app.container.copypastemove import MoveSource
-from zope.app.container.copypastemove import PasteNamesChooser
from zope.app.copypastemove import ObjectMover
from zope.app.content.file import File
from zope.exceptions import NotFoundError, DuplicationError
@@ -41,15 +35,12 @@
PlacefulSetup.setUp(self)
PlacefulSetup.buildFolders(self)
provideAdapter(None, IObjectMover, ObjectMover)
- provideAdapter(IContainer, IPasteTarget, PasteTarget)
- provideAdapter(IContainer, IMoveSource, MoveSource)
- provideAdapter(IContainer, IPasteNamesChooser, PasteNamesChooser)
def test_simplerename(self):
root = self.rootFolder
folder1 = traverse(root, 'folder1')
self.failIf('file1' in folder1)
- folder1.setObject('file1', File())
+ folder1['file1'] = File()
rename(folder1, 'file1', 'my_file1')
self.failIf('file1' in folder1)
self.failUnless('my_file1' in folder1)
@@ -65,8 +56,8 @@
folder1 = traverse(root, 'folder1')
self.failIf('file1' in folder1)
self.failIf('file2' in folder1)
- folder1.setObject('file1', File())
- folder1.setObject('file2', File())
+ folder1['file1'] = File()
+ folder1['file2'] = File()
self.assertRaises(DuplicationError, rename, folder1, 'file1', 'file2')
def test_suite():
More information about the Zope3-Checkins
mailing list