~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-30 10:41:04 UTC
  • mto: This revision was merged to the branch mainline in revision 2246.
  • Revision ID: robertc@robertcollins.net-20070130104104-wsikhrgretspg86m
Remove the static DefaultHooks method from Branch, replacing it with a derived dict BranchHooks object, which is easier to use and provides a place to put the policy-checking add method discussed on list.

Show diffs side-by-side

added added

removed removed

Lines of Context:
166
166
 
167
167
class TestHooks(TestCase):
168
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)
 
169
    def test_constructor(self):
 
170
        """Check that creating a BranchHooks instance has the right defaults."""
 
171
        hooks = bzrlib.branch.BranchHooks()
 
172
        self.assertTrue("set_rh" in hooks, "set_rh not in %s" % hooks)
174
173
 
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)
 
174
    def test_installed_hooks_are_BranchHooks(self):
 
175
        """The installed hooks object should be a BranchHooks."""
 
176
        # the installed hooks are saved in self._preserved_hooks.
 
177
        self.assertIsInstance(self._preserved_hooks, bzrlib.branch.BranchHooks)