[Zope3-checkins] CVS: Zope3/src/zope/app/ftp/tests - test_ftpview.py:1.3.22.3

Jim Fulton jim at zope.com
Fri Sep 12 15:15:58 EDT 2003


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

Modified Files:
      Tag: parentgeddon-branch
	test_ftpview.py 
Log Message:
Can't have the tests passing, can we?

=== Zope3/src/zope/app/ftp/tests/test_ftpview.py 1.3.22.2 => 1.3.22.3 ===
--- Zope3/src/zope/app/ftp/tests/test_ftpview.py:1.3.22.2	Mon Sep  8 18:36:54 2003
+++ Zope3/src/zope/app/ftp/tests/test_ftpview.py	Fri Sep 12 15:15:27 2003
@@ -26,7 +26,6 @@
 from zope.app.interfaces.file import IReadDirectory, IWriteDirectory
 from zope.app.interfaces.file import IFileFactory, IDirectoryFactory
 from zope.app.interfaces.dublincore import IZopeDublinCore
-from zope.app.interfaces.container import IAddTarget
 from zope.app.ftp import FTPView
 from zope.app.tests.placelesssetup import PlacelessSetup
 from zope.interface import implements
@@ -36,20 +35,18 @@
 class Directory(demofs.Directory, Contained):
 
     implements(IReadDirectory, IWriteDirectory, IFileFactory,
-               IDirectoryFactory, IAddTarget, IZopeDublinCore, IObjectMover)
+               IDirectoryFactory, IZopeDublinCore, IObjectMover)
 
     modified = datetime.datetime(1990, 1,1)
 
-    def setObject(self, name, object):
-        self[name] = contained(object, self, name)
+    def __setitem__(self, name, object):
+        object = contained(object, self, name)
+        demofs.Directory.__setitem__(self, name, object)
         self.modified = datetime.datetime.now()
-        return name
-
-    addObject = setObject
 
     def moveTo(self, target, new_name):
+        target[new_name] = self
         del self.__parent__[self.__name__]
-        target.setObject(new_name, self)
 
     def moveable(self):
         return True
@@ -108,10 +105,10 @@
     def setUp(self):
         PlacelessSetup.setUp(self)
         root = Directory()
-        root.setObject('test', Directory())
-        root.setObject('test2', Directory())
-        root.setObject('f', File('contents of\nf'))
-        root.setObject('g', File('contents of\ng'))
+        root['test'] = Directory()
+        root['test2'] = Directory()
+        root['f'] = File('contents of\nf')
+        root['g'] = File('contents of\ng')
         self.__view = FTPView(root, None)
 
     def test_type(self):




More information about the Zope3-Checkins mailing list