~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Patch Queue Manager
  • Date: 2016-01-15 09:21:49 UTC
  • mfrom: (6606.2.1 autodoc-unicode)
  • Revision ID: pqm@pqm.ubuntu.com-20160115092149-z5f4sfq3jvaz0enb
(vila) Fix autodoc runner when LANG=C. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
16
 
16
17
"""
17
18
Facilities to use ftp test servers.
18
19
"""
20
21
import sys
21
22
 
22
23
from bzrlib import tests
 
24
from bzrlib.tests import (
 
25
    features,
 
26
    )
23
27
 
24
28
 
25
29
try:
26
30
    from bzrlib.tests.ftp_server import medusa_based
27
 
    # medusa is bogus under python2.6
28
 
    medusa_available = sys.version_info < (2, 6)
 
31
    # medusa is bogus starting with python2.6, since we don't support earlier
 
32
    # pythons anymore, it's currently useless. There is hope though that the
 
33
    # unicode bugs get fixed in the future so we leave it disabled until
 
34
    # then. Keeping the framework in place means that only the following line
 
35
    # will need to be changed.  The last tests were conducted with medusa-2.0
 
36
    # -- vila 20110607
 
37
    medusa_available = False
29
38
except ImportError:
30
39
    medusa_available = False
31
40
 
32
41
 
33
42
try:
34
43
    from bzrlib.tests.ftp_server import pyftpdlib_based
35
 
    pyftpdlib_available = True
 
44
    if pyftpdlib_based.pyftplib_version >= (0, 7, 0):
 
45
        pyftpdlib_available = True
 
46
    else:
 
47
        # 0.6.0 breaks SITE CHMOD
 
48
        pyftpdlib_available = False
36
49
except ImportError:
37
50
    pyftpdlib_available = False
38
51
 
39
52
 
40
 
class _FTPServerFeature(tests.Feature):
 
53
class _FTPServerFeature(features.Feature):
41
54
    """Some tests want an FTP Server, check if one is available.
42
55
 
43
56
    Right now, the only way this is available is if one of the following is