~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_lockdir.py

  • Committer: Martin Pool
  • Date: 2008-05-27 03:24:31 UTC
  • mto: (3724.1.1 lock-hooks)
  • mto: This revision was merged to the branch mainline in revision 3730.
  • Revision ID: mbp@sourcefrog.net-20080527032431-3bjagu9x4vquh1y0
Remove PhysicalLock class

Show diffs side-by-side

added added

removed removed

Lines of Context:
657
657
    def restore_hooks(self):
658
658
        LockDir.hooks = self._old_hooks
659
659
 
660
 
    def test_PhysicalLock_acquired_success(self):
661
 
        # the PhysicalLock.lock_acquired hook fires when a lock is acquired.
 
660
    def test_LockDir_acquired_success(self):
 
661
        # the LockDir.lock_acquired hook fires when a lock is acquired.
662
662
        self._calls = []
663
663
        self.reset_hooks()
664
664
        LockDir.hooks.install_named_hook('lock_acquired',
672
672
        ld.unlock()
673
673
        self.assertEqual([lock.LockResult(lock_path, result)], self._calls)
674
674
 
675
 
    def test_PhysicalLock_acquired_fail(self):
676
 
        # the PhysicalLock.lock_acquired hook does not fire on failure.
 
675
    def test_LockDir_acquired_fail(self):
 
676
        # the LockDir.lock_acquired hook does not fire on failure.
677
677
        self._calls = []
678
678
        self.reset_hooks()
679
679
        ld = self.get_lock()
688
688
        ld2.unlock()
689
689
        self.assertEqual([], self._calls)
690
690
 
691
 
    def test_PhysicalLock_released_success(self):
692
 
        # the PhysicalLock.lock_released hook fires when a lock is acquired.
 
691
    def test_LockDir_released_success(self):
 
692
        # the LockDir.lock_released hook fires when a lock is acquired.
693
693
        self._calls = []
694
694
        self.reset_hooks()
695
695
        LockDir.hooks.install_named_hook('lock_released',
703
703
        lock_path = ld.transport.abspath(ld.path)
704
704
        self.assertEqual([lock.LockResult(lock_path, result)], self._calls)
705
705
 
706
 
    def test_PhysicalLock_released_fail(self):
707
 
        # the PhysicalLock.lock_released hook does not fire on failure.
 
706
    def test_LockDir_released_fail(self):
 
707
        # the LockDir.lock_released hook does not fire on failure.
708
708
        self._calls = []
709
709
        self.reset_hooks()
710
710
        ld = self.get_lock()