~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_branch.py

  • Committer: Robert Collins
  • Date: 2007-01-29 16:58:49 UTC
  • mto: This revision was merged to the branch mainline in revision 2246.
  • Revision ID: robertc@robertcollins.net-20070129165849-409f5714fa7ebe48
New Branch hooks facility, with one initial hook 'set_rh' which triggers
whenever the revision history is set. This allows triggering on e.g.
push, pull, commit, and so on. Developed for use with the branchrss
plugin. See bzrlib/tests/branch_implementations/test_hooks for more
details. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
162
162
        self.assertEqual(made_branch.base, target_branch.base)
163
163
        opened_branch = branch_dir.open_branch()
164
164
        self.assertEqual(opened_branch.base, target_branch.base)
 
165
 
 
166
 
 
167
class TestHooks(TestCase):
 
168
 
 
169
    def test_set_rh_in_defaults(self):
 
170
        """Check that the set_rh hook exists in the defaults."""
 
171
        default_hooks = bzrlib.branch.Branch.DefaultHooks()
 
172
        self.assertTrue("set_rh" in default_hooks,
 
173
            "set_rh not in %s" % default_hooks)
 
174
 
 
175
    def test_set_rh_in_actual_hooks(self):
 
176
        """Check that the set_rh hook exists in the saved hook set."""
 
177
        self.assertTrue("set_rh" in self._preserved_hooks,
 
178
            "set_rh not in %s" % self._preserved_hooks)