~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_ftp_transport.py

  • Committer: Robert Collins
  • Date: 2010-04-08 04:34:03 UTC
  • mfrom: (5138 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5139.
  • Revision ID: robertc@robertcollins.net-20100408043403-56z0d07vdqrx7f3t
Update bugfix for 528114 to trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006 Canonical Ltd
 
1
# Copyright (C) 2006, 2010 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
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
from cStringIO import StringIO
 
18
import ftplib
18
19
import getpass
19
20
import sys
20
21
 
21
22
from bzrlib import (
22
23
    config,
 
24
    errors,
23
25
    tests,
24
26
    transport,
25
27
    ui,
26
28
    )
27
29
 
 
30
from bzrlib.transport import ftp
 
31
 
28
32
from bzrlib.tests import ftp_server
29
33
 
30
34
 
130
134
        # stdin should be empty (the provided password have been consumed),
131
135
        # even if the password is empty, it's followed by a newline.
132
136
        ui.ui_factory.assert_all_input_consumed()
 
137
 
 
138
 
 
139
class TestFTPErrorTranslation(tests.TestCase):
 
140
 
 
141
    def test_translate_directory_not_empty(self):
 
142
        # https://bugs.launchpad.net/bugs/528722
 
143
        
 
144
        t = ftp.FtpTransport("ftp://none/")
 
145
 
 
146
        try:
 
147
            raise ftplib.error_temp("Rename/move failure: Directory not empty")
 
148
        except Exception, e:
 
149
            e = self.assertRaises(errors.DirectoryNotEmpty,
 
150
                t._translate_ftp_error, e, "/path")