~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_bzrdir/test_bzrdir.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-04-12 00:26:47 UTC
  • mfrom: (5143.1.2 colo-tests)
  • Revision ID: pqm@pqm.ubuntu.com-20100412002647-n2uymlq2ac1uf3rc
(Jelmer) Add per_bzrdir_colo tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
252
252
        bzrdir.create_branch()
253
253
        bzrdir.open_branch()
254
254
 
255
 
    def test_destroy_colocated_branch(self):
256
 
        branch = self.make_branch('branch')
257
 
        bzrdir = branch.bzrdir
258
 
        try:
259
 
            colo_branch = bzrdir.create_branch('colo')
260
 
        except errors.NoColocatedBranchSupport:
261
 
            raise TestNotApplicable('BzrDir does not do colocated branches')
262
 
        bzrdir.destroy_branch("colo")
263
 
        self.assertRaises(errors.NotBranchError, bzrdir.open_branch, 
264
 
                          "colo")
265
 
 
266
255
    def test_destroy_repository(self):
267
256
        repo = self.make_repository('repository')
268
257
        bzrdir = repo.bzrdir
1421
1410
        self.failUnless(isinstance(made_branch, bzrlib.branch.Branch))
1422
1411
        self.assertEqual(made_control, made_branch.bzrdir)
1423
1412
 
1424
 
    def test_create_colo_branch(self):
1425
 
        # a bzrdir can construct a branch and repository for itself.
1426
 
        if not self.bzrdir_format.is_supported():
1427
 
            # unsupported formats are not loopback testable
1428
 
            # because the default open will not open them and
1429
 
            # they may not be initializable.
1430
 
            raise TestNotApplicable('Control dir format not supported')
1431
 
        t = get_transport(self.get_url())
1432
 
        made_control = self.bzrdir_format.initialize(t.base)
1433
 
        made_repo = made_control.create_repository()
1434
 
        try:
1435
 
            made_branch = made_control.create_branch("colo")
1436
 
        except errors.NoColocatedBranchSupport:
1437
 
            raise TestNotApplicable('Colocated branches not supported')
1438
 
        self.failUnless(isinstance(made_branch, bzrlib.branch.Branch))
1439
 
        self.assertEqual(made_control, made_branch.bzrdir)
1440
 
 
1441
1413
    def test_open_branch(self):
1442
1414
        if not self.bzrdir_format.is_supported():
1443
1415
            # unsupported formats are not loopback testable