def test_start_dst_invalid_occurrence(self):
"""Test that tzcron updates the offset when moving to DST"""
cron_expression = "30 1 * * * *"
timezone = pytz.timezone("Europe/London")
start = dt.datetime.strptime('2015-03-29T00:00:00',
"%Y-%m-%dT%H:%M:%S")
start = timezone.localize(start, is_dst=False)
testee = tzcron.Schedule(cron_expression, timezone, start)
self.assertRaises(pytz.NonExistentTimeError,
lambda: next(testee))
评论列表
文章目录