~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_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:
701
701
        self.assertIsInstance(t, local.LocalTransport)
702
702
        self.assertEquals(t.base.rstrip("/"), url)
703
703
 
 
704
    def test_with_url_and_segment_parameters(self):
 
705
        url = urlutils.local_path_to_url(self.test_dir)+",branch=foo"
 
706
        t = transport.get_transport_from_url(url)
 
707
        self.assertIsInstance(t, local.LocalTransport)
 
708
        self.assertEquals(t.base.rstrip("/"), url)
 
709
        with open(os.path.join(self.test_dir, "afile"), 'w') as f:
 
710
            f.write("data")
 
711
        self.assertTrue(t.has("afile"))
 
712
 
704
713
 
705
714
class TestLocalTransports(tests.TestCase):
706
715
 
796
805
        self.assertEquals(t._parsed_url.path, '/path/')
797
806
 
798
807
        # Base should not keep track of the password
799
 
        self.assertEquals(t.base, 'http://robey@exAmple.com:2222/path/')
 
808
        self.assertEquals(t.base, 'http://ro%62ey@ex%41mple.com:2222/path/')
800
809
 
801
810
    def test_parse_invalid_url(self):
802
811
        self.assertRaises(errors.InvalidURL,