'Only hosts that are status=Ready, unlocked and not invalid get
scheduled.'

def _test_hosts_ready_helper(self, use_metahosts):

    self._create_job_simple([1], use_metahosts)
    self._do_query('UPDATE    afe_hosts    SET    status="Running"    WHERE    id=1')
    self._run_scheduler()
    self._check_for_extra_schedulings()
    self._do_query('UPDATE    afe_hosts    SET    status="Ready",    locked=1    WHERE    id=1')
    self._run_scheduler()
    self._check_for_extra_schedulings()
    self._do_query('UPDATE    afe_hosts    SET    locked=0,    invalid=1    WHERE    id=1')
    self._run_scheduler()
    if (not use_metahosts):
        self._assert_job_scheduled_on(1, 1)
    self._check_for_extra_schedulings()
