~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_ftp_transport.py

  • Committer: Tarmac
  • Author(s): Vincent Ladeuil
  • Date: 2017-01-30 14:42:05 UTC
  • mfrom: (6620.1.1 trunk)
  • Revision ID: tarmac-20170130144205-r8fh2xpmiuxyozpv
Merge  2.7 into trunk including fix for bug #1657238 [r=vila]

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
    tests,
24
24
    transport,
25
25
    ui,
 
26
    urlutils,
26
27
    )
27
28
 
28
29
from bzrlib.transport import ftp
43
44
    """Test aftp transport."""
44
45
 
45
46
    def test_aftp_degrade(self):
46
 
        t = transport.get_transport('aftp://host/path')
 
47
        t = transport.get_transport_from_url('aftp://host/path')
47
48
        self.assertTrue(t.is_active)
48
49
        parent = t.clone('..')
49
50
        self.assertTrue(parent.is_active)
81
82
    def get_url(self, relpath=None):
82
83
        """Overrides get_url to inject our user."""
83
84
        base = super(TestFTPTestServerUI, self).get_url(relpath)
84
 
        (scheme, user, password,
85
 
         host, port, path) = transport.ConnectedTransport._split_url(base)
86
 
        url = transport.ConnectedTransport._unsplit_url(
87
 
            scheme, self.user, self.password, host, port, path)
88
 
        return url
 
85
        parsed_url = transport.ConnectedTransport._split_url(base)
 
86
        new_url = parsed_url.clone()
 
87
        new_url.user = self.user
 
88
        new_url.quoted_user = urlutils.quote(self.user)
 
89
        new_url.password = self.password
 
90
        new_url.quoted_password = urlutils.quote(self.password)
 
91
        return str(new_url)
89
92
 
90
93
    def test_no_prompt_for_username(self):
91
94
        """ensure getpass.getuser() is used if there's no username in the