Exemple #1
0
    def test_job_init__from_job_ids(self):
        job_ids = ALL_JOBS.copy()
        job_ids.remove(BATCH_PARENT)

        with mock.patch(CLIENTS, get_mock_client):
            jobs = Job.from_job_ids(job_ids, return_list=False)

        for job_id, job in jobs.items():
            self.check_job_attrs(job, job_id)
Exemple #2
0
def get_batch_family_jobs(return_list=False):
    """
    As invoked in appmanager's run_app_batch, i.e.,
    with from_job_id(s)
    """
    child_jobs = Job.from_job_ids(BATCH_CHILDREN, return_list=True)
    batch_job = Job.from_job_id(BATCH_PARENT, children=child_jobs)

    if return_list:
        return [batch_job] + child_jobs
    else:
        return {
            BATCH_PARENT: batch_job,
            **{
                child_id: child_job
                for child_id, child_job in zip(BATCH_CHILDREN, child_jobs)
            },
        }