'Should raise a DaemonError on receiving an OSError from setuid.'

def test_raises_daemon_error_on_os_error_from_setuid(self):

    args = self.test_args
    test_error = OSError(errno.EPERM, 'No    switching    for    you!')
    os.setuid.mock_raises = test_error
    expect_error = daemon.daemon.DaemonOSEnvironmentError
    self.failUnlessRaises(expect_error, daemon.daemon.change_process_owner, **args)
