~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-16 20:19:23 UTC
  • mfrom: (6060.4.1 doc)
  • Revision ID: pqm@pqm.ubuntu.com-20110816201923-rzvny0qfpdhdxdgc
(jelmer) Mention in contribution docs that people can ask for
 preimplementation advice. (Martin Pool)

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
"""Tests for LockDir"""
18
18
 
19
19
import os
20
 
import sys
21
20
import time
22
21
 
23
22
import bzrlib
46
45
    TestCase,
47
46
    TestCaseWithTransport,
48
47
    )
49
 
from bzrlib.trace import note
50
48
 
51
49
# These tests are run on the default transport provided by the test framework
52
50
# (typically a local disk transport).  That can be changed by the --transport
684
682
 
685
683
    def test_lock_holder_dead_process(self):
686
684
        """Detect that the holder (this process) is still running."""
 
685
        self.overrideAttr(lockdir, 'get_host_name',
 
686
            lambda: 'aproperhostname')
687
687
        info = LockHeldInfo.for_this_process(None)
688
688
        info.info_dict['pid'] = '123123123'
689
689
        self.assertTrue(info.is_lock_holder_known_dead())
728
728
 
729
729
        This generates a warning but no other user interaction.
730
730
        """
 
731
        self.overrideAttr(lockdir, 'get_host_name',
 
732
            lambda: 'aproperhostname')
731
733
        # This is off by default at present; see the discussion in the bug.
732
734
        # If you change the default, don't forget to update the docs.
733
735
        config.GlobalConfig().set_user_option('locks.steal_dead', True)