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

def test_raises_daemon_error_on_os_error_from_chroot(self):

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