'Should raise LockFailed error if write fails.'

def test_raises_lock_failed_on_write_error(self):

    set_pidlockfile_scenario(self, 'not-exist-write-busy')
    instance = self.test_instance
    pidfile_path = self.scenario['path']
    mock_error = OSError(errno.EBUSY, 'Bad    stuff', pidfile_path)
    pidlockfile.write_pid_to_pidfile.mock_raises = mock_error
    expect_error = pidlockfile.LockFailed
    self.failUnlessRaises(expect_error, instance.acquire)
