[Zope-Checkins] CVS: Zope3/lib/python/Zope/Server/FTP/tests - testFTPServer.py:1.1.2.4
Shane Hathaway
shane@cvs.zope.org
Wed, 10 Apr 2002 17:59:52 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/Server/FTP/tests
In directory cvs.zope.org:/tmp/cvs-serv18340/FTP/tests
Modified Files:
Tag: Zope3-Server-Branch
testFTPServer.py
Log Message:
- Removed AlternateSocketMapMixin. It was there to support multiple socket
maps, but if we really need multiple socket maps, it would be better to
change asyncore. Had to update a lot of __init__ methods.
- Added IUsernamePassword and IFilesystemAccess, which provide a way to
implement all kinds of authentication schemes without FTP knowing about
any of the details. Modified FTPServerChannel to work based on an
IFilesystemAccess object.
- Added detection of the ZOPE_SERVER_DEBUG env var.
- Added comments here and there.
- Fixed CRs :-)
=== Zope3/lib/python/Zope/Server/FTP/tests/testFTPServer.py 1.1.2.3 => 1.1.2.4 ===
from Zope.Server.ITask import ITask
-from Zope.Server.Authentication.DictionaryAuthentication import \
- DictionaryAuthentication
+from Zope.Server.VFS.OSFileSystem import OSFileSystem
+from Zope.Server.FTP.TestFilesystemAccess import TestFilesystemAccess
import ftplib
@@ -46,9 +46,6 @@
my_adj = Adjustments()
-# Reduce overflows to make testing easier.
-my_adj.outbuf_overflow = 10000
-my_adj.inbuf_overflow = 10000
def retrlines(ftpconn, cmd):
@@ -67,8 +64,10 @@
os.mkdir(self.root_dir)
os.mkdir(os.path.join(self.root_dir, 'test'))
- self.server = FTPServer(LOCALHOST, SERVER_PORT, self.root_dir,
- DictionaryAuthentication({'foo': 'bar'}),
+ fs = OSFileSystem(self.root_dir)
+ fs_access = TestFilesystemAccess(fs)
+
+ self.server = FTPServer(LOCALHOST, SERVER_PORT, fs_access,
task_dispatcher=td, adj=my_adj)
if CONNECT_TO_PORT == 0:
self.port = self.server.socket.getsockname()[1]