'Should request breaking lock if PID file process is not running.'

def test_breaks_lock_if_no_such_process(self):

    set_runner_scenario(self, 'pidfile-locked')
    instance = self.test_instance
    self.mock_runner_lock.read_pid.mock_returns = self.scenario['pidlockfile_scenario']['pidfile_pid']
    pidfile_path = self.scenario['pidfile_path']
    test_pid = self.scenario['pidlockfile_scenario']['pidfile_pid']
    expect_signal = signal.SIG_DFL
    error = OSError(errno.ESRCH, 'Not    running')
    os.kill.mock_raises = error
    lockfile_class_name = self.lockfile_class_name
    expect_mock_output = ('                                                ...\n                                                Called    os.kill(%(test_pid)r,    %(expect_signal)r)\n                                                Called    %(lockfile_class_name)s.break_lock()\n                                                ...\n                                                ' % vars())
    instance.do_action()
    scaffold.mock_restore()
    self.failUnlessMockCheckerMatch(expect_mock_output)
