~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_lockdir.py

  • Committer: Ross Lagerwall
  • Date: 2012-08-07 06:32:51 UTC
  • mto: (6437.63.5 2.5)
  • mto: This revision was merged to the branch mainline in revision 6558.
  • Revision ID: rosslagerwall@gmail.com-20120807063251-x9p03ghg2ws8oqjc
Add bzrlib/locale to .bzrignore

bzrlib/locale is generated with ./setup.py build_mo which is in turn called
by ./setup.py build

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2012, 2016 Canonical Ltd
 
1
# Copyright (C) 2006-2011 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
433
433
        self.assertContainsRe(info_list['time_ago'], r'^\d+ seconds? ago$')
434
434
 
435
435
    def test_lock_without_email(self):
436
 
        global_config = config.GlobalStack()
 
436
        global_config = config.GlobalConfig()
437
437
        # Intentionally has no email address
438
 
        global_config.set('email', 'User Identity')
 
438
        global_config.set_user_option('email', 'User Identity')
439
439
        ld1 = self.get_lock()
440
440
        ld1.create()
441
441
        ld1.lock_write()
475
475
        # now the original caller should succeed in unlocking
476
476
        ld1.unlock()
477
477
        # and there should be nothing left over
478
 
        self.assertEqual([], t.list_dir('test_lock'))
 
478
        self.assertEquals([], t.list_dir('test_lock'))
479
479
 
480
480
    def test_failed_lock_leaves_no_trash(self):
481
481
        # if we fail to acquire the lock, we don't leave pending directories
487
487
        t = self.get_transport().clone('test_lock')
488
488
 
489
489
        def check_dir(a):
490
 
            self.assertEqual(a, t.list_dir('.'))
 
490
            self.assertEquals(a, t.list_dir('.'))
491
491
 
492
492
        check_dir([])
493
493
        # when held, that's all we see
512
512
        lf = LockDir(t, 'test_lock')
513
513
        info = lf.peek()
514
514
        formatted_info = info.to_readable_dict()
515
 
        self.assertEqual(
 
515
        self.assertEquals(
516
516
            dict(user='<unknown>', hostname='<unknown>', pid='<unknown>',
517
517
                time_ago='(unknown)'),
518
518
            formatted_info)
734
734
            lambda: 'aproperhostname')
735
735
        # This is off by default at present; see the discussion in the bug.
736
736
        # If you change the default, don't forget to update the docs.
737
 
        config.GlobalStack().set('locks.steal_dead', True)
 
737
        config.GlobalConfig().set_user_option('locks.steal_dead', True)
738
738
        # Create a lock pretending to come from a different nonexistent
739
739
        # process on the same machine.
740
740
        l1 = LockDir(self.get_transport(), 'a',