'Should raise error if cannot send signal to daemon process.'

def test_raises_error_if_cannot_send_signal_to_process(self):

    instance = self.test_instance
    test_pid = self.scenario['pidlockfile_scenario']['pidfile_pid']
    pidfile_path = self.scenario['pidfile_path']
    error = OSError(errno.EPERM, 'Nice    try')
    os.kill.mock_raises = error
    expect_error = runner.DaemonRunnerStopFailureError
    expect_message_content = str(test_pid)
    try:
        instance.do_action()
    except expect_error as exc:
        pass
    else:
        raise self.failureException(('Failed    to    raise    ' + expect_error.__name__))
    scaffold.mock_restore()
    self.failUnlessIn(exc.message, expect_message_content)
