Rev 4064: split pyftpdlib thread to isolate medusa related changes in file:///net/bigmamac/Volumes/home/vila/src/bzr/experimental/more-ftp/

Vincent Ladeuil v.ladeuil+lp at free.fr
Sat Feb 28 21:02:02 GMT 2009


At file:///net/bigmamac/Volumes/home/vila/src/bzr/experimental/more-ftp/

------------------------------------------------------------
revno: 4064
revision-id: v.ladeuil+lp at free.fr-20090228210158-cpwfhldwzmlyirfa
parent: pqm at pqm.ubuntu.com-20090227165204-wtg2koex221f2g8b
parent: v.ladeuil+lp at free.fr-20090228170617-3ezbrszcsdad3mqh
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: disable-medusa-for-python-2.6
timestamp: Sat 2009-02-28 22:01:58 +0100
message:
  split pyftpdlib thread to isolate medusa related changes
added:
  bzrlib/tests/ftp_server/       ftp_server-20090227112800-4r9jkezw2hw9tij7-1
  bzrlib/tests/ftp_server/__init__.py __init__.py-20090227130107-4gcpgvr00l7v3fsw-1
renamed:
  bzrlib/tests/ftp_server.py => bzrlib/tests/ftp_server/medusa_based.py ftpserver.py-20071019102346-61jbvdkrr70igauv-1
modified:
  bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
  bzrlib/tests/test_ftp_transport.py test_aftp_transport.-20060823221619-98mwjzxtwtkt527k-1
  bzrlib/transport/ftp/__init__.py ftp.py-20051116161804-58dc9506548c2a53
  bzrlib/tests/ftp_server/medusa_based.py ftpserver.py-20071019102346-61jbvdkrr70igauv-1
    ------------------------------------------------------------
    revno: 3508.1.8
    revision-id: v.ladeuil+lp at free.fr-20090228170617-3ezbrszcsdad3mqh
    parent: v.ladeuil+lp at free.fr-20090227132613-ez1i849mn2xpt97q
    parent: v.ladeuil+lp at free.fr-20090228170605-foexzya9e468zrc7
    committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
    branch nick: pyftpdlib
    timestamp: Sat 2009-02-28 18:06:17 +0100
    message:
      Merge binary-mode into pyftpdlib
    added:
      doc/en/user-guide/filtered_views.txt filtered_views.txt-20090226100856-a16ba1v97v91ru58-1
    modified:
      NEWS                           NEWS-20050323055033-4e00b5db738777ff
      bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
      bzrlib/fetch.py                fetch.py-20050818234941-26fea6105696365d
      bzrlib/graph.py                graph_walker.py-20070525030359-y852guab65d4wtn0-1
      bzrlib/remote.py               remote.py-20060720103555-yeeg2x51vn0rbtdp-1
      bzrlib/repofmt/knitrepo.py     knitrepo.py-20070206081537-pyy4a00xdas0j4pf-1
      bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
      bzrlib/repofmt/weaverepo.py    presplitout.py-20070125045333-wfav3tsh73oxu3zk-1
      bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
      bzrlib/smart/bzrdir.py         bzrdir.py-20061122024551-ol0l0o0oofsu9b3t-1
      bzrlib/smart/request.py        request.py-20061108095550-gunadhxmzkdjfeek-1
      bzrlib/tests/blackbox/test_push.py test_push.py-20060329002750-929af230d5d22663
      bzrlib/tests/branch_implementations/test_create_clone.py test_create_clone.py-20090225031440-8ybpkzojo7cvourv-1
      bzrlib/tests/branch_implementations/test_push.py test_push.py-20070130153159-fhfap8uoifevg30j-1
      bzrlib/tests/per_repository/test_repository.py test_repository.py-20060131092128-ad07f494f5c9d26c
      bzrlib/tests/test_fetch.py     testfetch.py-20050825090644-f73e07e7dfb1765a
      bzrlib/tests/test_graph.py     test_graph_walker.py-20070525030405-enq4r60hhi9xrujc-1
      bzrlib/tests/test_pack_repository.py test_pack_repository-20080801043947-eaw0e6h2gu75kwmy-1
      bzrlib/tests/test_remote.py    test_remote.py-20060720103555-yeeg2x51vn0rbtdp-2
      bzrlib/tests/test_repository.py test_repository.py-20060131075918-65c555b881612f4d
      bzrlib/tests/test_smart.py     test_smart.py-20061122024551-ol0l0o0oofsu9b3t-2
      bzrlib/transport/remote.py     ssh.py-20060608202016-c25gvf1ob7ypbus6-1
      doc/en/user-guide/index.txt    index.txt-20060622101119-tgwtdci8z769bjb9-2
        ------------------------------------------------------------
        revno: 3508.3.1
        revision-id: v.ladeuil+lp at free.fr-20090228170605-foexzya9e468zrc7
        parent: v.ladeuil+lp at free.fr-20090227084436-4j9864kycsieuycj
        parent: v.ladeuil+lp at free.fr-20090228170555-5atqlgvoiy36rd71
        committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
        branch nick: binary-mode
        timestamp: Sat 2009-02-28 18:06:05 +0100
        message:
          Merge fix-chmod into binary-mode
        added:
          doc/en/user-guide/filtered_views.txt filtered_views.txt-20090226100856-a16ba1v97v91ru58-1
        modified:
          NEWS                           NEWS-20050323055033-4e00b5db738777ff
          bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
          bzrlib/fetch.py                fetch.py-20050818234941-26fea6105696365d
          bzrlib/graph.py                graph_walker.py-20070525030359-y852guab65d4wtn0-1
          bzrlib/remote.py               remote.py-20060720103555-yeeg2x51vn0rbtdp-1
          bzrlib/repofmt/knitrepo.py     knitrepo.py-20070206081537-pyy4a00xdas0j4pf-1
          bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
          bzrlib/repofmt/weaverepo.py    presplitout.py-20070125045333-wfav3tsh73oxu3zk-1
          bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
          bzrlib/smart/bzrdir.py         bzrdir.py-20061122024551-ol0l0o0oofsu9b3t-1
          bzrlib/smart/request.py        request.py-20061108095550-gunadhxmzkdjfeek-1
          bzrlib/tests/blackbox/test_push.py test_push.py-20060329002750-929af230d5d22663
          bzrlib/tests/branch_implementations/test_create_clone.py test_create_clone.py-20090225031440-8ybpkzojo7cvourv-1
          bzrlib/tests/branch_implementations/test_push.py test_push.py-20070130153159-fhfap8uoifevg30j-1
          bzrlib/tests/per_repository/test_repository.py test_repository.py-20060131092128-ad07f494f5c9d26c
          bzrlib/tests/test_fetch.py     testfetch.py-20050825090644-f73e07e7dfb1765a
          bzrlib/tests/test_graph.py     test_graph_walker.py-20070525030405-enq4r60hhi9xrujc-1
          bzrlib/tests/test_pack_repository.py test_pack_repository-20080801043947-eaw0e6h2gu75kwmy-1
          bzrlib/tests/test_remote.py    test_remote.py-20060720103555-yeeg2x51vn0rbtdp-2
          bzrlib/tests/test_repository.py test_repository.py-20060131075918-65c555b881612f4d
          bzrlib/tests/test_smart.py     test_smart.py-20061122024551-ol0l0o0oofsu9b3t-2
          bzrlib/transport/remote.py     ssh.py-20060608202016-c25gvf1ob7ypbus6-1
          doc/en/user-guide/index.txt    index.txt-20060622101119-tgwtdci8z769bjb9-2
        ------------------------------------------------------------
        revno: 3508.2.1
        revision-id: v.ladeuil+lp at free.fr-20090228170555-5atqlgvoiy36rd71
        parent: v.ladeuil+lp at free.fr-20090226193006-mleqjssvlnebdeea
        parent: pqm at pqm.ubuntu.com-20090227165204-wtg2koex221f2g8b
        committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
        branch nick: fix-chmod
        timestamp: Sat 2009-02-28 18:05:55 +0100
        message:
          Merge bzr.dev into fix-chmod
        added:
          doc/en/user-guide/filtered_views.txt filtered_views.txt-20090226100856-a16ba1v97v91ru58-1
        modified:
          NEWS                           NEWS-20050323055033-4e00b5db738777ff
          bzrlib/bzrdir.py               bzrdir.py-20060131065624-156dfea39c4387cb
          bzrlib/fetch.py                fetch.py-20050818234941-26fea6105696365d
          bzrlib/graph.py                graph_walker.py-20070525030359-y852guab65d4wtn0-1
          bzrlib/remote.py               remote.py-20060720103555-yeeg2x51vn0rbtdp-1
          bzrlib/repofmt/knitrepo.py     knitrepo.py-20070206081537-pyy4a00xdas0j4pf-1
          bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
          bzrlib/repofmt/weaverepo.py    presplitout.py-20070125045333-wfav3tsh73oxu3zk-1
          bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
          bzrlib/smart/bzrdir.py         bzrdir.py-20061122024551-ol0l0o0oofsu9b3t-1
          bzrlib/smart/request.py        request.py-20061108095550-gunadhxmzkdjfeek-1
          bzrlib/tests/blackbox/test_push.py test_push.py-20060329002750-929af230d5d22663
          bzrlib/tests/branch_implementations/test_create_clone.py test_create_clone.py-20090225031440-8ybpkzojo7cvourv-1
          bzrlib/tests/branch_implementations/test_push.py test_push.py-20070130153159-fhfap8uoifevg30j-1
          bzrlib/tests/per_repository/test_repository.py test_repository.py-20060131092128-ad07f494f5c9d26c
          bzrlib/tests/test_fetch.py     testfetch.py-20050825090644-f73e07e7dfb1765a
          bzrlib/tests/test_graph.py     test_graph_walker.py-20070525030405-enq4r60hhi9xrujc-1
          bzrlib/tests/test_pack_repository.py test_pack_repository-20080801043947-eaw0e6h2gu75kwmy-1
          bzrlib/tests/test_remote.py    test_remote.py-20060720103555-yeeg2x51vn0rbtdp-2
          bzrlib/tests/test_repository.py test_repository.py-20060131075918-65c555b881612f4d
          bzrlib/tests/test_smart.py     test_smart.py-20061122024551-ol0l0o0oofsu9b3t-2
          bzrlib/transport/ftp/__init__.py ftp.py-20051116161804-58dc9506548c2a53
          bzrlib/transport/remote.py     ssh.py-20060608202016-c25gvf1ob7ypbus6-1
          doc/en/user-guide/index.txt    index.txt-20060622101119-tgwtdci8z769bjb9-2
    ------------------------------------------------------------
    revno: 3508.1.7
    revision-id: v.ladeuil+lp at free.fr-20090227132613-ez1i849mn2xpt97q
    parent: v.ladeuil+lp at free.fr-20090227084436-4j9864kycsieuycj
    committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
    branch nick: pyftpdlib
    timestamp: Fri 2009-02-27 14:26:13 +0100
    message:
      Prepare test framework for pyftpdlib injection.
      
      * bzrlib/tests/ftp_server/__init__.py:
      Provide a single front-end for ftp test servers.
      
      * bzrlib/tests/test_ftp_transport.py: 
      Use ftp_server import.
      
      * bzrlib/transport/ftp/__init__.py:
      (get_test_permutations): Simplified.
      
      * bzrlib/tests/__init__.py:
      (FTPServerFeature): Moved to bzrlib/tests/ftp_server/__init__.py.
    added:
      bzrlib/tests/ftp_server/       ftp_server-20090227112800-4r9jkezw2hw9tij7-1
      bzrlib/tests/ftp_server/__init__.py __init__.py-20090227130107-4gcpgvr00l7v3fsw-1
    renamed:
      bzrlib/tests/ftp_server.py => bzrlib/tests/ftp_server/medusa_based.py ftpserver.py-20071019102346-61jbvdkrr70igauv-1
    modified:
      bzrlib/tests/__init__.py       selftest.py-20050531073622-8d0e3c8845c97a64
      bzrlib/tests/test_ftp_transport.py test_aftp_transport.-20060823221619-98mwjzxtwtkt527k-1
      bzrlib/transport/ftp/__init__.py ftp.py-20051116161804-58dc9506548c2a53
      bzrlib/tests/ftp_server/medusa_based.py ftpserver.py-20071019102346-61jbvdkrr70igauv-1
-------------- next part --------------
=== modified file 'bzrlib/tests/__init__.py'
--- a/bzrlib/tests/__init__.py	2009-02-25 23:52:42 +0000
+++ b/bzrlib/tests/__init__.py	2009-02-27 13:26:13 +0000
@@ -3307,27 +3307,6 @@
     return None
 
 
-class _FTPServerFeature(Feature):
-    """Some tests want an FTP Server, check if one is available.
-
-    Right now, the only way this is available is if 'medusa' is installed.
-    http://www.amk.ca/python/code/medusa.html
-    """
-
-    def _probe(self):
-        try:
-            import bzrlib.tests.ftp_server
-            return True
-        except ImportError:
-            return False
-
-    def feature_name(self):
-        return 'FTPServer'
-
-
-FTPServerFeature = _FTPServerFeature()
-
-
 class _HTTPSServerFeature(Feature):
     """Some tests want an https Server, check if one is available.
 

=== added directory 'bzrlib/tests/ftp_server'
=== added file 'bzrlib/tests/ftp_server/__init__.py'
--- a/bzrlib/tests/ftp_server/__init__.py	1970-01-01 00:00:00 +0000
+++ b/bzrlib/tests/ftp_server/__init__.py	2009-02-27 13:26:13 +0000
@@ -0,0 +1,73 @@
+# Copyright (C) 2009 Canonical Ltd
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+"""
+Facilities to use ftp test servers.
+"""
+
+from bzrlib import tests
+
+
+try:
+    from bzrlib.tests.ftp_server import medusa_based
+    medusa_available = True
+except ImportError:
+    medusa_available = False
+
+
+class _FTPServerFeature(tests.Feature):
+    """Some tests want an FTP Server, check if one is available.
+
+    Right now, the only way this is available is if 'medusa' is installed.
+    http://www.amk.ca/python/code/medusa.html
+    """
+
+    def _probe(self):
+        return medusa_available
+
+    def feature_name(self):
+        return 'FTPServer'
+
+
+FTPServerFeature = _FTPServerFeature()
+
+
+class UnavailableFTPServer(object):
+    """Dummy ftp test server.
+
+    
+    This allows the test suite report the number of tests needing that
+    feature. We raise UnavailableFeature from methods before the test server is
+    being used. Doing so in the setUp method has bad side-effects (tearDown is
+    never called).
+    """
+
+    def setUp(self, vfs_server=None):
+        pass
+
+    def tearDown(self):
+        pass
+
+    def get_url(self):
+        raise tests.UnavailableFeature(FTPServerFeature)
+
+    def get_bogus_url(self):
+        raise tests.UnavailableFeature(FTPServerFeature)
+
+
+if medusa_available:
+    FTPServer = medusa_based.FTPServer
+else:
+    FTPServer = UnavailableFTPServer

=== renamed file 'bzrlib/tests/ftp_server.py' => 'bzrlib/tests/ftp_server/medusa_based.py'
--- a/bzrlib/tests/ftp_server.py	2009-01-17 01:30:58 +0000
+++ b/bzrlib/tests/ftp_server/medusa_based.py	2009-02-27 13:26:13 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2007 Canonical Ltd
+# Copyright (C) 2007, 2008, 2009 Canonical Ltd
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by

=== modified file 'bzrlib/tests/test_ftp_transport.py'
--- a/bzrlib/tests/test_ftp_transport.py	2007-11-04 15:29:17 +0000
+++ b/bzrlib/tests/test_ftp_transport.py	2009-02-27 13:26:13 +0000
@@ -24,13 +24,14 @@
     ui,
     )
 
+from bzrlib.tests import ftp_server
+
 
 class TestCaseWithFTPServer(tests.TestCaseWithTransport):
 
-    _test_needs_features = [tests.FTPServerFeature]
+    _test_needs_features = [ftp_server.FTPServerFeature]
 
     def setUp(self):
-        from bzrlib.tests import ftp_server
         self.transport_server = ftp_server.FTPServer
         super(TestCaseWithFTPServer, self).setUp()
 

=== modified file 'bzrlib/transport/ftp/__init__.py'
--- a/bzrlib/transport/ftp/__init__.py	2009-02-27 08:44:36 +0000
+++ b/bzrlib/transport/ftp/__init__.py	2009-02-27 13:26:13 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2005, 2006, 2007 Canonical Ltd
+# Copyright (C) 2005, 2006, 2007, 2008, 2009 Canonical Ltd
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -597,27 +597,5 @@
 
 def get_test_permutations():
     """Return the permutations to be used in testing."""
-    from bzrlib import tests
-    if tests.FTPServerFeature.available():
-        from bzrlib.tests import ftp_server
-        return [(FtpTransport, ftp_server.FTPServer)]
-    else:
-        # Dummy server to have the test suite report the number of tests
-        # needing that feature. We raise UnavailableFeature from methods before
-        # the test server is being used. Doing so in the setUp method has bad
-        # side-effects (tearDown is never called).
-        class UnavailableFTPServer(object):
-
-            def setUp(self, vfs_server=None):
-                pass
-
-            def tearDown(self):
-                pass
-
-            def get_url(self):
-                raise tests.UnavailableFeature(tests.FTPServerFeature)
-
-            def get_bogus_url(self):
-                raise tests.UnavailableFeature(tests.FTPServerFeature)
-
-        return [(FtpTransport, UnavailableFTPServer)]
+    from bzrlib.tests import ftp_server
+    return [(FtpTransport, ftp_server.FTPServer)]



More information about the bazaar-commits mailing list