Example #1
0
def test_db_all_in_one_AR_3(monkeypatch):

    now = get_date()
    job = insert_and_sched_ar(now + 1000)
    new_start_time = now - 2000

    set_jobs_start_time(tuple([job.id]), new_start_time)
    db.query(GanttJobsPrediction).update({GanttJobsPrediction.start_time: new_start_time},
                                         synchronize_session=False)
    db.commit()

    meta_schedule('internal')

    job = db['Job'].query.one()
    print('\n', job.id, job.state, ' ', job.reservation, job.start_time)

    assert job.state == 'Error'
Example #2
0
def test_db_all_in_one_AR_6(monkeypatch):

    now = get_date()
    job = insert_and_sched_ar(now + 10, 600)
    new_start_time = now - 350

    set_jobs_start_time(tuple([job.id]), new_start_time)
    db.query(GanttJobsPrediction).update({GanttJobsPrediction.start_time: new_start_time},
                                         synchronize_session=False)

    # db.query(Resource).update({Resource.state: 'Suspected'}, synchronize_session=False)

    meta_schedule('internal')

    job = db['Job'].query.one()
    print('\n', job.id, job.state, ' ', job.reservation, job.start_time)

    assert job.state == 'Waiting'