~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/ftp_server/medusa_based.py

  • Committer: Vincent Ladeuil
  • Date: 2009-03-19 14:57:51 UTC
  • mfrom: (3508.1.24 pyftpdlib)
  • mto: This revision was merged to the branch mainline in revision 4168.
  • Revision ID: v.ladeuil+lp@free.fr-20090319145751-6vg1h5oo1jox3wsw
FTP test server: disable medusa for python2.6, add pyftpdlib

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007 Canonical Ltd
 
1
# Copyright (C) 2007, 2008, 2009 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
210
210
        trace.mutter('ftp_server %s: %s', type, message)
211
211
 
212
212
 
213
 
class FTPServer(transport.Server):
 
213
class FTPTestServer(transport.Server):
214
214
    """Common code for FTP server facilities."""
215
215
 
216
216
    def __init__(self):
250
250
        # Don't let it loop forever, or handle an infinite number of requests.
251
251
        # In this case it will run for 1000s, or 10000 requests
252
252
        self._async_thread = threading.Thread(
253
 
                target=FTPServer._asyncore_loop_ignore_EBADF,
 
253
                target=FTPTestServer._asyncore_loop_ignore_EBADF,
254
254
                kwargs={'timeout':0.1, 'count':10000})
255
255
        self._async_thread.setDaemon(True)
256
256
        self._async_thread.start()
279
279
            if e.args[0] != errno.EBADF:
280
280
                raise
281
281
 
282
 
 
283
 
 
 
282
    def add_user(self, user, password):
 
283
        """Add a user with write access."""
 
284
        authorizer = server = self._ftp_server.authorizer
 
285
        authorizer.secured_user = user
 
286
        authorizer.secured_password = password
284
287