~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-09 17:04:46 UTC
  • mfrom: (6055.1.3 822571-bzr-home-unicode)
  • Revision ID: pqm@pqm.ubuntu.com-20110809170446-f1wc1a8fhgnxi4cn
(vila) Decode BZR_HOME with fs encoding to allow unicode homes. (Vincent
 Ladeuil)

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
20
21
import time
21
22
 
22
23
import bzrlib
45
46
    TestCase,
46
47
    TestCaseWithTransport,
47
48
    )
 
49
from bzrlib.trace import note
48
50
 
49
51
# These tests are run on the default transport provided by the test framework
50
52
# (typically a local disk transport).  That can be changed by the --transport
682
684
 
683
685
    def test_lock_holder_dead_process(self):
684
686
        """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')
733
731
        # This is off by default at present; see the discussion in the bug.
734
732
        # If you change the default, don't forget to update the docs.
735
733
        config.GlobalConfig().set_user_option('locks.steal_dead', True)