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

Jim Fulton jim at zope.com
Mon Sep 15 14:13:05 EDT 2003


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

Modified Files:
      Tag: parentgeddon-branch
	test_ftpview.py 
Log Message:
Got lots of tests to pass.

Added a setitem helper function to be used to help satisfy container
contracts.



=== Zope3/src/zope/app/ftp/tests/test_ftpview.py 1.3.22.3 => 1.3.22.4 ===
--- Zope3/src/zope/app/ftp/tests/test_ftpview.py:1.3.22.3	Fri Sep 12 15:15:27 2003
+++ Zope3/src/zope/app/ftp/tests/test_ftpview.py	Mon Sep 15 14:12:32 2003
@@ -30,7 +30,7 @@
 from zope.app.tests.placelesssetup import PlacelessSetup
 from zope.interface import implements
 from zope.app.interfaces.copypastemove import IObjectMover
-from zope.app.container.contained import contained, Contained
+from zope.app.container.contained import setitem, Contained
 
 class Directory(demofs.Directory, Contained):
 
@@ -40,13 +40,14 @@
     modified = datetime.datetime(1990, 1,1)
 
     def __setitem__(self, name, object):
-        object = contained(object, self, name)
-        demofs.Directory.__setitem__(self, name, object)
+        setitem(self, super(Directory, self).__setitem__, name, object)
         self.modified = datetime.datetime.now()
 
     def moveTo(self, target, new_name):
+        source = self.__parent__
+        old_name = self.__name__
         target[new_name] = self
-        del self.__parent__[self.__name__]
+        del source[old_name]
 
     def moveable(self):
         return True




More information about the Zope3-Checkins mailing list