~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_bzrdir.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-04-22 17:08:27 UTC
  • mfrom: (5107.3.8 new_branch_and_repo_hooks)
  • Revision ID: pqm@pqm.ubuntu.com-20100422170827-h0bb41yq5nkosu6t
(vila) Add 'post_repo_init', 'post_branch_init' and 'post_switch' hooks. (Marco Pantaleoni)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1339
1339
        url = transport.base
1340
1340
        err = self.assertRaises(errors.BzrError, bzrdir.BzrDir.open, url)
1341
1341
        self.assertEqual('fail', err._preformatted_string)
 
1342
 
 
1343
    def test_post_repo_init(self):
 
1344
        from bzrlib.bzrdir import RepoInitHookParams
 
1345
        calls = []
 
1346
        bzrdir.BzrDir.hooks.install_named_hook('post_repo_init',
 
1347
            calls.append, None)
 
1348
        self.make_repository('foo')
 
1349
        self.assertLength(1, calls)
 
1350
        params = calls[0]
 
1351
        self.assertIsInstance(params, RepoInitHookParams)
 
1352
        self.assertTrue(hasattr(params, 'bzrdir'))
 
1353
        self.assertTrue(hasattr(params, 'repository'))