~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Aaron Bentley
  • Date: 2010-05-10 11:34:20 UTC
  • mfrom: (5218 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5221.
  • Revision ID: aaron@aaronbentley.com-20100510113420-toh2d5yioobb5uq1
Merged bzr.dev into transform-commit-full.

Show diffs side-by-side

added added

removed removed

Lines of Context:
217
217
        b = branch.Branch.open('b')
218
218
        self.assertEndsWith(b.get_bound_location(), '/a/')
219
219
 
 
220
    def test_branch_with_post_branch_init_hook(self):
 
221
        calls = []
 
222
        branch.Branch.hooks.install_named_hook('post_branch_init',
 
223
            calls.append, None)
 
224
        self.assertLength(0, calls)
 
225
        self.example_branch('a')
 
226
        self.assertLength(1, calls)
 
227
        self.run_bzr('branch a b')
 
228
        self.assertLength(2, calls)
 
229
 
 
230
    def test_checkout_with_post_branch_init_hook(self):
 
231
        calls = []
 
232
        branch.Branch.hooks.install_named_hook('post_branch_init',
 
233
            calls.append, None)
 
234
        self.assertLength(0, calls)
 
235
        self.example_branch('a')
 
236
        self.assertLength(1, calls)
 
237
        self.run_bzr('checkout a b')
 
238
        self.assertLength(2, calls)
 
239
 
 
240
    def test_lightweight_checkout_with_post_branch_init_hook(self):
 
241
        calls = []
 
242
        branch.Branch.hooks.install_named_hook('post_branch_init',
 
243
            calls.append, None)
 
244
        self.assertLength(0, calls)
 
245
        self.example_branch('a')
 
246
        self.assertLength(1, calls)
 
247
        self.run_bzr('checkout --lightweight a b')
 
248
        self.assertLength(2, calls)
 
249
 
220
250
 
221
251
class TestBranchStacked(ExternalBase):
222
252
    """Tests for branch --stacked"""