diff options
author | Alex Grönholm <alex.gronholm@nextday.fi> | 2016-08-02 02:05:01 +0300 |
---|---|---|
committer | Alex Grönholm <alex.gronholm@nextday.fi> | 2016-08-02 02:07:50 +0300 |
commit | 4a23598815130a8a35022bcc4a6ffb4d9db04dd5 (patch) | |
tree | 0ca34498be490bd279dd19f1905b3c502b500668 /tests | |
parent | cd5daf6bccbad22edb6443cdcb367b61cca7df94 (diff) | |
download | apscheduler-4a23598815130a8a35022bcc4a6ffb4d9db04dd5.tar.gz |
Fixed CronTrigger's range expression allowing values outside of the range
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_triggers.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_triggers.py b/tests/test_triggers.py index a86d685..4c15cf9 100644 --- a/tests/test_triggers.py +++ b/tests/test_triggers.py @@ -160,6 +160,12 @@ class TestCronTrigger(object): def test_cron_bad_kwarg(self, timezone): pytest.raises(TypeError, CronTrigger, second=0, third=1, timezone=timezone) + def test_month_rollover(self, timezone): + trigger = CronTrigger(timezone=timezone, day=30) + now = timezone.localize(datetime(2016, 2, 1)) + expected = timezone.localize(datetime(2016, 3, 30)) + assert trigger.get_next_fire_time(None, now) == expected + def test_timezone_from_start_date(self, timezone): """ Tests that the trigger takes the timezone from the start_date parameter if no timezone is |