~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_lockdir.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-08-15 13:49:38 UTC
  • mfrom: (6060.3.1 fix-last-revno-args)
  • Revision ID: pqm@pqm.ubuntu.com-20110815134938-4fuo63g4v2hj8jdt
(jelmer) Cope with the localhost having the name 'localhost' when running
 the test suite. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
682
682
 
683
683
    def test_lock_holder_dead_process(self):
684
684
        """Detect that the holder (this process) is still running."""
 
685
        self.overrideAttr(lockdir, 'get_host_name',
 
686
            lambda: 'aproperhostname')
685
687
        info = LockHeldInfo.for_this_process(None)
686
688
        info.info_dict['pid'] = '123123123'
687
689
        self.assertTrue(info.is_lock_holder_known_dead())
726
728
 
727
729
        This generates a warning but no other user interaction.
728
730
        """
 
731
        self.overrideAttr(lockdir, 'get_host_name',
 
732
            lambda: 'aproperhostname')
729
733
        # This is off by default at present; see the discussion in the bug.
730
734
        # If you change the default, don't forget to update the docs.
731
735
        config.GlobalConfig().set_user_option('locks.steal_dead', True)