~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_ftp_transport.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-02-11 04:02:41 UTC
  • mfrom: (5017.2.2 tariff)
  • Revision ID: pqm@pqm.ubuntu.com-20100211040241-w6n021dz0uus341n
(mbp) add import-tariff tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006, 2010 Canonical Ltd
 
1
# Copyright (C) 2006 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
19
18
import getpass
20
19
import sys
21
20
 
22
21
from bzrlib import (
23
22
    config,
24
 
    errors,
25
23
    tests,
26
24
    transport,
27
25
    ui,
28
26
    )
29
27
 
30
 
from bzrlib.transport import ftp
31
 
 
32
28
from bzrlib.tests import ftp_server
33
29
 
34
30
 
134
130
        # stdin should be empty (the provided password have been consumed),
135
131
        # even if the password is empty, it's followed by a newline.
136
132
        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")