def test_repeating_end_after_repeat(): rr = RepeatingTimeReference(start=dt("2013-01-01 09:00"), frequency=10, end_after_repeat=2) assert rr.next_after(dt("2013-01-01 09:19")) == dt("2013-01-01 09:20") assert rr.next_after(dt("2013-01-01 09:20")) is None assert rr.next_after(dt("2013-01-01 09:21")) is None
def test_repeating_end_after_time(): rr = RepeatingTimeReference(start=dt("2013-01-01 09:00"), frequency=10, end_after_time=dt("2013-01-01 10:00")) assert rr.next_after(dt("2013-01-02 10:00")) is None
def test_repeating(start_date, freq, dt, expected): assert RepeatingTimeReference(start_date, freq).next_after(dt) == expected