예제 #1
0
        async def get_task_valid_task():
            s = Scheduler()
            t_id = s.schedule_at(foo, time=datetime(year=2100, month=1, day=1))

            s.cancel(t_id)

            assert len(s._scheduled_tasks) == 0
예제 #2
0
        async def get_task_valid_task():
            s = Scheduler()
            t_id = s.schedule_in(foo, time=1)

            s.cancel(t_id)

            assert len(s._scheduled_tasks) == 0
예제 #3
0
        async def get_task_valid_task():
            s = Scheduler()
            s.schedule_in(foo, time=1)

            with pytest.raises(KeyError):
                s.cancel(1)
예제 #4
0
        async def get_task_valid_task():
            s = Scheduler()
            t_id = s.schedule_at(foo, time=datetime(year=2100, month=1, day=1))

            with pytest.raises(KeyError):
                s.cancel(1)