~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_bzrdir_colo/test_unsupported.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-05-07 11:50:28 UTC
  • mfrom: (5147.4.7 more-colo)
  • Revision ID: pqm@pqm.ubuntu.com-20100507115028-tuuxmnormm8oetw6
(vila, for jelmer) Pass the colocated branch name along in more places,
        add extra tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
 
36
36
class TestNoColocatedSupport(TestCaseWithBzrDir):
37
37
 
38
 
    def test_destroy_colocated_branch(self):
39
 
        branch = self.make_branch('branch')
40
 
        # Colocated branches should not be supported *or* 
41
 
        # destroy_branch should not be supported at all
42
 
        self.assertRaises(
43
 
            (errors.NoColocatedBranchSupport, errors.UnsupportedOperation),
44
 
            branch.bzrdir.destroy_branch, 'colo')
45
 
 
46
 
    def test_create_colo_branch(self):
 
38
    def make_bzrdir_with_repo(self):
47
39
        # a bzrdir can construct a branch and repository for itself.
48
40
        if not self.bzrdir_format.is_supported():
49
41
            # unsupported formats are not loopback testable
53
45
        t = get_transport(self.get_url())
54
46
        made_control = self.bzrdir_format.initialize(t.base)
55
47
        made_repo = made_control.create_repository()
 
48
        return made_control
 
49
 
 
50
    def test_destroy_colocated_branch(self):
 
51
        branch = self.make_branch('branch')
 
52
        # Colocated branches should not be supported *or* 
 
53
        # destroy_branch should not be supported at all
 
54
        self.assertRaises(
 
55
            (errors.NoColocatedBranchSupport, errors.UnsupportedOperation),
 
56
            branch.bzrdir.destroy_branch, 'colo')
 
57
 
 
58
    def test_create_colo_branch(self):
 
59
        made_control = self.make_bzrdir_with_repo()
56
60
        self.assertRaises(errors.NoColocatedBranchSupport, 
57
61
            made_control.create_branch, "colo")
58
62
 
 
63
    def test_branch_transport(self):
 
64
        made_control = self.make_bzrdir_with_repo()
 
65
        self.assertRaises(errors.NoColocatedBranchSupport,
 
66
            made_control.get_branch_transport, None, "colo")
59
67
 
 
68
    def test_get_branch_reference(self):
 
69
        made_control = self.make_bzrdir_with_repo()
 
70
        self.assertRaises(errors.NoColocatedBranchSupport,
 
71
            made_control.get_branch_reference, "colo")