~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_lockdir.py

  • Committer: Patch Queue Manager
  • Date: 2014-02-12 18:22:22 UTC
  • mfrom: (6589.2.1 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20140212182222-beouo25gaf1cny76
(vila) The XDG Base Directory Specification uses the XDG_CACHE_HOME,
 not XDG_CACHE_DIR. (Andrew Starr-Bochicchio)

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
from bzrlib.tests import (
44
44
    features,
45
45
    TestCase,
 
46
    TestCaseInTempDir,
46
47
    TestCaseWithTransport,
47
48
    )
48
49
 
432
433
        self.assertContainsRe(info_list['time_ago'], r'^\d+ seconds? ago$')
433
434
 
434
435
    def test_lock_without_email(self):
435
 
        global_config = config.GlobalConfig()
 
436
        global_config = config.GlobalStack()
436
437
        # Intentionally has no email address
437
 
        global_config.set_user_option('email', 'User Identity')
 
438
        global_config.set('email', 'User Identity')
438
439
        ld1 = self.get_lock()
439
440
        ld1.create()
440
441
        ld1.lock_write()
463
464
    def test_lock_with_buggy_rename(self):
464
465
        # test that lock acquisition handles servers which pretend they
465
466
        # renamed correctly but that actually fail
466
 
        t = transport.get_transport('brokenrename+' + self.get_url())
 
467
        t = transport.get_transport_from_url(
 
468
            'brokenrename+' + self.get_url())
467
469
        ld1 = LockDir(t, 'test_lock')
468
470
        ld1.create()
469
471
        ld1.attempt_lock()
653
655
        self.assertEqual([], self._calls)
654
656
 
655
657
 
656
 
class TestLockHeldInfo(TestCase):
 
658
class TestLockHeldInfo(TestCaseInTempDir):
657
659
    """Can get information about the lock holder, and detect whether they're
658
660
    still alive."""
659
661
 
732
734
            lambda: 'aproperhostname')
733
735
        # This is off by default at present; see the discussion in the bug.
734
736
        # If you change the default, don't forget to update the docs.
735
 
        config.GlobalConfig().set_user_option('locks.steal_dead', True)
 
737
        config.GlobalStack().set('locks.steal_dead', True)
736
738
        # Create a lock pretending to come from a different nonexistent
737
739
        # process on the same machine.
738
740
        l1 = LockDir(self.get_transport(), 'a',