~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

  • Committer: Jelmer Vernooij
  • Date: 2011-08-19 22:34:02 UTC
  • mto: This revision was merged to the branch mainline in revision 6089.
  • Revision ID: jelmer@samba.org-20110819223402-wjywqb0fa1xxx522
Use get_transport_from_{url,path} in more places.

Show diffs side-by-side

added added

removed removed

Lines of Context:
619
619
    def test_dangling_locks_cause_failures(self):
620
620
        class TestDanglingLock(tests.TestCaseWithMemoryTransport):
621
621
            def test_function(self):
622
 
                t = self.get_transport('.')
 
622
                t = self.get_transport_from_path('.')
623
623
                l = lockdir.LockDir(t, 'lock')
624
624
                l.create()
625
625
                l.attempt_lock()
645
645
        # for the server
646
646
        url = self.get_readonly_url()
647
647
        url2 = self.get_readonly_url('foo/bar')
648
 
        t = transport.get_transport(url)
649
 
        t2 = transport.get_transport(url2)
 
648
        t = transport.get_transport_from_url(url)
 
649
        t2 = transport.get_transport_from_url(url2)
650
650
        self.assertIsInstance(t, ReadonlyTransportDecorator)
651
651
        self.assertIsInstance(t2, ReadonlyTransportDecorator)
652
652
        self.assertEqual(t2.base[:-1], t.abspath('foo/bar'))
660
660
        url = self.get_readonly_url()
661
661
        url2 = self.get_readonly_url('foo/bar')
662
662
        # the transport returned may be any HttpTransportBase subclass
663
 
        t = transport.get_transport(url)
664
 
        t2 = transport.get_transport(url2)
 
663
        t = transport.get_transport_from_url(url)
 
664
        t2 = transport.get_transport_from_url(url2)
665
665
        self.assertIsInstance(t, HttpTransportBase)
666
666
        self.assertIsInstance(t2, HttpTransportBase)
667
667
        self.assertEqual(t2.base[:-1], t.abspath('foo/bar'))
705
705
class TestChrootedTest(tests.ChrootedTestCase):
706
706
 
707
707
    def test_root_is_root(self):
708
 
        t = transport.get_transport(self.get_readonly_url())
 
708
        t = transport.get_transport_from_url(self.get_readonly_url())
709
709
        url = t.base
710
710
        self.assertEqual(url, t.clone('..').base)
711
711
 
1490
1490
        transport_server = memory.MemoryServer()
1491
1491
        transport_server.start_server()
1492
1492
        self.addCleanup(transport_server.stop_server)
1493
 
        t = transport.get_transport(transport_server.get_url())
 
1493
        t = transport.get_transport_from_url(transport_server.get_url())
1494
1494
        bzrdir.BzrDir.create(t.base)
1495
1495
        self.assertRaises(errors.BzrError,
1496
1496
            bzrdir.BzrDir.open_from_transport, t)