[Zope3-checkins] CVS: Zope3/src/zope/app/ftp/tests -
test_ftpview.py:1.3.22.2
Jim Fulton
jim at zope.com
Mon Sep 8 19:37:25 EDT 2003
Update of /cvs-repository/Zope3/src/zope/app/ftp/tests
In directory cvs.zope.org:/tmp/cvs-serv31668/src/zope/app/ftp/tests
Modified Files:
Tag: parentgeddon-branch
test_ftpview.py
Log Message:
got more tests to pass
=== Zope3/src/zope/app/ftp/tests/test_ftpview.py 1.3.22.1 => 1.3.22.2 ===
--- Zope3/src/zope/app/ftp/tests/test_ftpview.py:1.3.22.1 Mon Sep 8 14:21:39 2003
+++ Zope3/src/zope/app/ftp/tests/test_ftpview.py Mon Sep 8 18:36:54 2003
@@ -30,21 +30,33 @@
from zope.app.ftp import FTPView
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
-class Directory(demofs.Directory):
+class Directory(demofs.Directory, Contained):
implements(IReadDirectory, IWriteDirectory, IFileFactory,
- IDirectoryFactory, IAddTarget, IZopeDublinCore)
+ IDirectoryFactory, IAddTarget, IZopeDublinCore, IObjectMover)
modified = datetime.datetime(1990, 1,1)
def setObject(self, name, object):
- self[name] = object
+ self[name] = contained(object, self, name)
self.modified = datetime.datetime.now()
return name
addObject = setObject
+ def moveTo(self, target, new_name):
+ del self.__parent__[self.__name__]
+ target.setObject(new_name, self)
+
+ def moveable(self):
+ return True
+
+ def moveableTo(self, target, name=None):
+ return True
+
def __call__(self, name, content_type='', data=None):
if data:
r = File()
@@ -96,10 +108,10 @@
def setUp(self):
PlacelessSetup.setUp(self)
root = Directory()
- root['test'] = Directory()
- root['test2'] = Directory()
- root['f'] = File('contents of\nf')
- root['g'] = File('contents of\ng')
+ root.setObject('test', Directory())
+ root.setObject('test2', Directory())
+ root.setObject('f', File('contents of\nf'))
+ root.setObject('g', File('contents of\ng'))
self.__view = FTPView(root, None)
def test_type(self):
More information about the Zope3-Checkins
mailing list