Ejemplo n.º 1
0
def test_job_details():
    job = JobDetails(dbkey=-1,
                     jobname='test',
                     jobkey='dummy',
                     appname='test',
                     logfile='test.log',
                     job_config=str({}),
                     timestamp=0,
                     infile_ids=[3, 4],
                     outfile_ids=[6, 7],
                     rm_ids=[3],
                     status=JobStatus.no_job)
    job_dict = {job.dbkey: job}
    table, table_ids = JobDetails.make_tables(job_dict)
    job_dict2 = JobDetails.make_dict(table, table_ids)
    job2 = job_dict2[job.dbkey]

    assert (job.jobname == job2.jobname)
    assert (job.dbkey == job2.dbkey)
    assert (job.logfile == job2.logfile)
    assert (job.status == job2.status)
Ejemplo n.º 2
0
def test_job_details():    
    job = JobDetails(dbkey=-1,
                     jobname='test',
                     jobkey='dummy',
                     appname='test',
                     logfile='test.log',
                     job_config=str({}),
                     timestamp=0,
                     infile_ids=[3,4],
                     outfile_ids=[6,7],
                     rm_ids=[3],
                     status=JobStatus.no_job)
    job_dict = {job.dbkey:job}
    table, table_ids = JobDetails.make_tables(job_dict)
    job_dict2 = JobDetails.make_dict(table, table_ids)    
    job2 = job_dict2[job.dbkey]
    
    assert(job.jobname == job2.jobname)
    assert(job.dbkey == job2.dbkey)
    assert(job.logfile == job2.logfile)
    assert(job.status == job2.status)
Ejemplo n.º 3
0
def test_job_details():
    """ Test that we can build a `JobDetails` object """

    job = JobDetails(dbkey=-1,
                     jobname='test',
                     jobkey='dummy',
                     appname='test',
                     logfile='test.log',
                     job_config=str({}),
                     timestamp=0,
                     infile_ids=[3, 4],
                     outfile_ids=[6, 7],
                     rm_ids=[3],
                     status=JobStatus.no_job)
    job_dict = {job.dbkey: job}
    table, table_ids = JobDetails.make_tables(job_dict)
    job_dict2 = JobDetails.make_dict(table)
    job2 = job_dict2[job.dbkey]

    assert_str_eq(job.jobname, job2.jobname)
    assert_str_eq(job.dbkey, job2.dbkey)
    assert_str_eq(job.logfile, job2.logfile)
    assert_str_eq(job.status, job2.status)