~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_bound_branches.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-09-18 02:51:19 UTC
  • mfrom: (4691.2.5 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090918025119-eqkrmtj09t2hqs2t
(robertc) Add test suite enforcement of BzrDir objects outside the
        test area. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
class TestBoundBranches(TestCaseWithTransport):
65
65
 
66
66
    def create_branches(self):
67
 
        self.build_tree(['base/', 'base/a', 'base/b'])
68
 
 
69
 
        branch = self.init_meta_branch('base')
70
 
        base_tree = branch.bzrdir.open_workingtree()
 
67
        base_tree = self.make_branch_and_tree('base')
71
68
        base_tree.lock_write()
 
69
        self.build_tree(['base/a', 'base/b'])
72
70
        base_tree.add(['a', 'b'])
73
71
        base_tree.commit('init')
74
72
        base_tree.unlock()
 
73
        branch = base_tree.branch
75
74
 
76
75
        child_tree = branch.create_checkout('child')
77
76
 
86
85
            val, len(BzrDir.open(loc).open_branch().revision_history()))
87
86
 
88
87
    def test_simple_binding(self):
89
 
        self.build_tree(['base/', 'base/a', 'base/b'])
90
 
 
91
 
        branch = self.init_meta_branch('base')
92
 
        tree = branch.bzrdir.open_workingtree()
 
88
        tree = self.make_branch_and_tree('base')
 
89
        self.build_tree(['base/a', 'base/b'])
93
90
        tree.add('a', 'b')
94
91
        tree.commit(message='init')
 
92
        branch = tree.branch
95
93
 
96
94
        tree.bzrdir.sprout('child')
97
95
 
131
129
        error = self.run_bzr('bind', retcode=3)[1]
132
130
        self.assertContainsRe(error, 'old locations')
133
131
 
134
 
    def init_meta_branch(self, path):
135
 
        format = bzrdir.format_registry.make_bzrdir('default')
136
 
        return BzrDir.create_branch_convenience(path, format=format)
137
 
 
138
132
    def test_bound_commit(self):
139
133
        child_tree = self.create_branches()[1]
140
134