예제 #1
0
def test_cancel_job_with_job_scheduled():
    scheduler.schedule_job("good_job", {"k": "v"}, "channel", TS, 0)

    scheduler.cancel_job("good_job")

    jj = scheduler.get_jobs_of_type("good_job")
    assert len(jj) == 0
예제 #2
0
def test_cancel_job_with_no_jobs_of_same_type_scheduled():
    scheduler.schedule_job("odd_job", {"k": "v"}, "channel")

    scheduler.cancel_job("good_job")

    jj = scheduler.get_jobs_of_type("odd_job")
    assert len(jj) == 1
예제 #3
0
def test_cancel_job_with_job_running(freezer):
    scheduler.schedule_job("good_job", {"k": "v"}, "channel", TS, 0)
    freezer.move_to(T(5))
    scheduler.reserve_job()

    scheduler.cancel_job("good_job")

    jj = scheduler.get_jobs_of_type("good_job")
    assert len(jj) == 1