diff options
-rw-r--r-- | dateutil/rrule.py | 2 | ||||
-rw-r--r-- | test.py | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/dateutil/rrule.py b/dateutil/rrule.py index 4c21d2d..8c63cf2 100644 --- a/dateutil/rrule.py +++ b/dateutil/rrule.py @@ -439,7 +439,7 @@ class rrule(rrulebase): (freq >= MINUTELY and self._byminute and minute not in self._byminute) or (freq >= SECONDLY and - self._bysecond and minute not in self._bysecond)): + self._bysecond and second not in self._bysecond)): timeset = () else: timeset = gettimeset(hour, minute, second) @@ -2372,6 +2372,17 @@ class RRuleTest(unittest.TestCase): datetime(1997, 9, 2, 18, 6, 18), datetime(1997, 9, 2, 18, 18, 6)]) + def testSecondlyByHourAndMinuteAndSecondBug(self): + # This explores a bug found by Mathieu Bridon. + self.assertEqual(list(rrule(SECONDLY, + count=3, + bysecond=(0,), + byminute=(1,), + dtstart=parse("20100322120100"))), + [datetime(2010, 3, 22, 12, 1), + datetime(2010, 3, 22, 13, 1), + datetime(2010, 3, 22, 14, 1)]) + def testUntilNotMatching(self): self.assertEqual(list(rrule(DAILY, count=3, |