~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_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:
1230
1230
            if host     is None: host     = t._parsed_url.host
1231
1231
            if port     is None: port     = t._parsed_url.port
1232
1232
            if path     is None: path     = t._parsed_url.path
1233
 
            return t._unsplit_url(scheme, user, password, host, port, path)
 
1233
            return str(urlutils.URL(scheme, user, password, host, port, path))
1234
1234
 
1235
1235
        if t._parsed_url.scheme == 'ftp':
1236
1236
            scheme = 'sftp'
1776
1776
        self.assertListRaises((errors.ShortReadvError, errors.InvalidRange),
1777
1777
                              transport.readv, 'a', [(12,2)])
1778
1778
 
 
1779
    def test_no_segment_parameters(self):
 
1780
        """Segment parameters should be stripped and stored in
 
1781
        transport.segment_parameters."""
 
1782
        transport = self.get_transport("foo")
 
1783
        self.assertEquals({}, transport.get_segment_parameters())
 
1784
 
 
1785
    def test_segment_parameters(self):
 
1786
        """Segment parameters should be stripped and stored in
 
1787
        transport.get_segment_parameters()."""
 
1788
        base_url = self._server.get_url()
 
1789
        parameters = {"key1": "val1", "key2": "val2"}
 
1790
        url = urlutils.join_segment_parameters(base_url, parameters)
 
1791
        transport = _mod_transport.get_transport(url)
 
1792
        self.assertEquals(parameters, transport.get_segment_parameters())
 
1793
 
1779
1794
    def test_stat_symlink(self):
1780
1795
        # if a transport points directly to a symlink (and supports symlinks
1781
1796
        # at all) you can tell this.  helps with bug 32669.