Skip to content

Commit a69b089

Browse files
committed
make bad cron test more dynamic
1 parent 3ed6047 commit a69b089

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/croniter/tests/test_croniter.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
from functools import partial
77
from time import sleep
88
import pytz
9-
from croniter import (croniter, CroniterBadDateError, CroniterBadCronError, datetime_to_timestamp,
9+
from croniter.croniter import VALID_LEN_EXPRESSION
10+
from croniter import (croniter, CroniterBadDateError, CroniterBadCronError, datetime_to_timestamp,
1011
CroniterNotAlphaError, CroniterUnsupportedSyntaxError)
1112
from croniter.tests import base
1213
import dateutil.tz
@@ -894,7 +895,7 @@ def test_error_bad_cron(self):
894895
self.assertRaises(CroniterBadCronError, croniter.expand,
895896
'* * * *')
896897
self.assertRaises(CroniterBadCronError, croniter.expand,
897-
'* * * * * * *')
898+
('* ' * (max(VALID_LEN_EXPRESSION) + 1)).strip())
898899

899900
def test_is_valid(self):
900901
self.assertTrue(croniter.is_valid('0 * * * *'))

0 commit comments

Comments
 (0)