~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

  • Committer: Jelmer Vernooij
  • Date: 2012-02-23 19:45:15 UTC
  • mto: This revision was merged to the branch mainline in revision 6486.
  • Revision ID: jelmer@samba.org-20120223194515-1ctgfzj362m0tu0k
Use bzrdir.controldir for generic access to control directories.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
from bzrlib import (
44
44
    branchbuilder,
45
45
    bzrdir,
 
46
    controldir,
46
47
    errors,
47
48
    hooks,
48
49
    lockdir,
609
610
        # Guard against regression into MemoryTransport leaking
610
611
        # files to disk instead of keeping them in memory.
611
612
        self.assertFalse(osutils.lexists('dir'))
612
 
        dir_format = bzrdir.format_registry.make_bzrdir('knit')
 
613
        dir_format = controldir.format_registry.make_bzrdir('knit')
613
614
        self.assertEqual(dir_format.repository_format.__class__,
614
615
                         the_branch.repository._format.__class__)
615
616
        self.assertEqual('Bazaar-NG Knit Repository Format 1',
678
679
        builder = self.make_branch_builder('dir')
679
680
        rev_id = builder.build_commit()
680
681
        self.assertPathExists('dir')
681
 
        a_dir = bzrdir.BzrDir.open('dir')
 
682
        a_dir = controldir.ControlDir.open('dir')
682
683
        self.assertRaises(errors.NoWorkingTree, a_dir.open_workingtree)
683
684
        a_branch = a_dir.open_branch()
684
685
        builder_branch = builder.get_branch()
1477
1478
        transport_server.start_server()
1478
1479
        self.addCleanup(transport_server.stop_server)
1479
1480
        t = transport.get_transport_from_url(transport_server.get_url())
1480
 
        bzrdir.BzrDir.create(t.base)
 
1481
        controldir.ControlDir.create(t.base)
1481
1482
        self.assertRaises(errors.BzrError,
1482
 
            bzrdir.BzrDir.open_from_transport, t)
 
1483
            controldir.ControlDir.open_from_transport, t)
1483
1484
        # But if we declare this as safe, we can open the bzrdir.
1484
1485
        self.permit_url(t.base)
1485
1486
        self._bzr_selftest_roots.append(t.base)
1486
 
        bzrdir.BzrDir.open_from_transport(t)
 
1487
        controldir.ControlDir.open_from_transport(t)
1487
1488
 
1488
1489
    def test_requireFeature_available(self):
1489
1490
        """self.requireFeature(available) is a no-op."""