Esempio n. 1
0
def test_next_datetime_with_range_values(cron_expr, first_of_june, expected):
    it = CrontabScheduler(cron_expr, first_of_june)
    assert next(it) == expected
Esempio n. 2
0
def test_next_datetime_with_repeat(cron_expr, first_of_june, repeat, expected):
    it = CrontabScheduler(cron_expr, first_of_june)
    for _ in range(repeat - 1):
        next(it)
    assert next(it) == expected
Esempio n. 3
0
def test_next_datetime_with_multiple_single_values(cron_expr, day_in_june,
                                                   expected):
    it = CrontabScheduler(cron_expr, day_in_june)
    assert next(it) == expected
Esempio n. 4
0
def test_next_datetime_with_step_values(cron_expr, day_in_june):
    with pytest.raises(ValueError):
        CrontabScheduler(cron_expr, day_in_june)