~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Andrew Bennetts
  • Date: 2010-02-12 04:33:05 UTC
  • mfrom: (5031 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5032.
  • Revision ID: andrew.bennetts@canonical.com-20100212043305-ujdbsdoviql2t7i3
MergeĀ lp:bzr

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
from bzrlib import (
34
34
    tests,
35
35
    trace,
36
 
    transport,
37
36
    )
 
37
from bzrlib.tests import test_server
38
38
 
39
39
 
40
40
class test_filesystem(medusa.filesys.os_filesystem):
210
210
        trace.mutter('ftp_server %s: %s', type, message)
211
211
 
212
212
 
213
 
class FTPTestServer(transport.Server):
 
213
class FTPTestServer(test_server.TestServer):
214
214
    """Common code for FTP server facilities."""
215
215
 
 
216
    no_unicode_support = True
 
217
 
216
218
    def __init__(self):
217
219
        self._root = None
218
220
        self._ftp_server = None
233
235
        """This is used by medusa.ftp_server to log connections, etc."""
234
236
        self.logs.append(message)
235
237
 
236
 
    def setUp(self, vfs_server=None):
237
 
        from bzrlib.transport.local import LocalURLServer
238
 
        if not (vfs_server is None or isinstance(vfs_server, LocalURLServer)):
 
238
    def start_server(self, vfs_server=None):
 
239
        if not (vfs_server is None or isinstance(vfs_server,
 
240
                                                 test_server.LocalURLServer)):
239
241
            raise AssertionError(
240
242
                "FTPServer currently assumes local transport, got %s" % vfs_server)
241
243
        self._root = os.getcwdu()
255
257
        self._async_thread.setDaemon(True)
256
258
        self._async_thread.start()
257
259
 
258
 
    def tearDown(self):
259
 
        """See bzrlib.transport.Server.tearDown."""
 
260
    def stop_server(self):
260
261
        self._ftp_server.close()
261
262
        asyncore.close_all()
262
263
        self._async_thread.join()