/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_bzrdir.py

  • Committer: John Arbash Meinel
  • Date: 2006-10-06 05:53:44 UTC
  • mfrom: (2063 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2071.
  • Revision ID: john@arbash-meinel.com-20061006055344-e73b97b7c6ca6e72
[merge] bzr.dev 2063

Show diffs side-by-side

added added

removed removed

Lines of Context:
392
392
            get_transport(self.get_readonly_url('g/p/q')))
393
393
        self.assertEqual('g/p/q', relpath)
394
394
 
 
395
    def test_open_from_transport(self):
 
396
        # transport pointing at bzrdir should give a bzrdir with root transport
 
397
        # set to the given transport
 
398
        control = bzrdir.BzrDir.create(self.get_url())
 
399
        transport = get_transport(self.get_url())
 
400
        opened_bzrdir = bzrdir.BzrDir.open_from_transport(transport)
 
401
        self.assertEqual(transport.base, opened_bzrdir.root_transport.base)
 
402
        self.assertIsInstance(opened_bzrdir, bzrdir.BzrDir)
 
403
        
 
404
    def test_open_from_transport_no_bzrdir(self):
 
405
        transport = get_transport(self.get_url())
 
406
        self.assertRaises(NotBranchError, bzrdir.BzrDir.open_from_transport,
 
407
                          transport)
 
408
 
 
409
    def test_open_from_transport_bzrdir_in_parent(self):
 
410
        control = bzrdir.BzrDir.create(self.get_url())
 
411
        transport = get_transport(self.get_url())
 
412
        transport.mkdir('subdir')
 
413
        transport = transport.clone('subdir')
 
414
        self.assertRaises(NotBranchError, bzrdir.BzrDir.open_from_transport,
 
415
                          transport)
 
416
 
395
417
 
396
418
class TestMeta1DirFormat(TestCaseWithTransport):
397
419
    """Tests specific to the meta1 dir format."""