~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: 2011-08-17 18:13:57 UTC
  • mfrom: (5268.7.29 transport-segments)
  • Revision ID: pqm@pqm.ubuntu.com-20110817181357-y5q5eth1hk8bl3om
(jelmer) Allow specifying the colocated branch to use in the branch URL,
 and retrieving the branch name using ControlDir._get_selected_branch.
 (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
import ftplib
18
18
import getpass
 
19
import urllib
19
20
 
20
21
from bzrlib import (
21
22
    config,
82
83
        """Overrides get_url to inject our user."""
83
84
        base = super(TestFTPTestServerUI, self).get_url(relpath)
84
85
        parsed_url = transport.ConnectedTransport._split_url(base)
85
 
        url = transport.ConnectedTransport._unsplit_url(
86
 
            parsed_url.scheme, self.user, self.password, parsed_url.host,
87
 
            parsed_url.port, parsed_url.path)
88
 
        return url
 
86
        new_url = parsed_url.clone()
 
87
        new_url.user = self.user
 
88
        new_url.quoted_user = urllib.quote(self.user)
 
89
        new_url.password = self.password
 
90
        new_url.quoted_password = urllib.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