def METHOD_NAME(self):
    self.env_object.status = 'Ready'
    self.mock_beanstalk.get_environment.return_value = self.env_object
    self.mock_beanstalk.rebuild_environment.side_effect = [
        InvalidParameterValueError('Could not rebuild environment some-name because the cname is taken')]
    self.assertRaises(InvalidParameterValueError, restoreops.restore, self.env_id)