Пример #1
0
def test_jobs_with_duration():
    j = Jobs()
    j.read_log_file('tdata/axiem_success.log')
    x = j.jobs_with_duration()
    assert len(x) == 1
    j.read_log_file('tdata/axiem_fail.log')
    x = j.jobs_with_duration()
    assert len(x) == 2
Пример #2
0
def test_fail_job_fields():
    j = Jobs()
    j.read_log_file('tdata/axiem_fail.log')
    jd = j.get_list()[0].job
    assert jd['R_MaxProcessors'] == '0'
    assert jd['R_MinProcessors'] == '1'
    assert jd['R_PreferredMemCap'] == 'low'
    assert jd['R_ThreadsPerProcessor'] == '1'
    assert jd['S_User'] == 'user4'
    assert jd['host'] == 'xyz0awrsim02'
    assert jd['exit'] == '-2147467259'
    assert jd['S_Name'] == 'AXIEM:4.0'
    assert jd['S_Priority'] == '1'
Пример #3
0
def test_number_of_jobs():
    j = Jobs()
    j.read_log_file('tdata/axiem_success.log')
    assert j.number_of_jobs() == 1
    j.read_log_file('tdata/axiem_fail.log')
    assert j.number_of_jobs() == 2
    j.read_log_file('tdata/analyst_success.log')
    assert j.number_of_jobs() == 3
Пример #4
0
def test_number_of_events():
    j = Jobs()
    j.read_log_file('tdata/axiem_success.log')
    assert len(j.timeline), 4
Пример #5
0
def test_get_list():
    j = Jobs()
    j.read_log_file('tdata/axiem_success.log')
    jobs = j.get_list()
    assert len(jobs) == 1
Пример #6
0
def test_multiple_logs():
    j = Jobs('tdata/axiem_success.log')
    j.read_log_file('tdata/axiem_fail.log')
    j.read_log_file('tdata/axiem_deque.log')
    assert j.number_of_jobs() == 3
    assert len(j.jobs_with_duration()) == 2