diff options
author | Paul Ganssle <paul@ganssle.io> | 2019-02-03 09:39:10 -0500 |
---|---|---|
committer | Paul Ganssle <paul@ganssle.io> | 2019-02-04 09:19:26 -0500 |
commit | 2f886a064f7ad707db34ce64ff9d2617eb6b5eeb (patch) | |
tree | 0f1332f2f285cbc2dd242da4bfa4bd96ec1882fe | |
parent | c17ea80dd267e1dbfc5da1fa620a6dc5a71df5ba (diff) | |
download | dateutil-2f886a064f7ad707db34ce64ff9d2617eb6b5eeb.tar.gz |
Add tests for multiple EXDATE and DTSTART values
-rw-r--r-- | dateutil/test/test_rrule.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/dateutil/test/test_rrule.py b/dateutil/test/test_rrule.py index c43fea1..9dfa544 100644 --- a/dateutil/test/test_rrule.py +++ b/dateutil/test/test_rrule.py @@ -2853,6 +2853,16 @@ class RRuleTest(WarningTestMixin, unittest.TestCase): datetime(1997, 9, 9, 9, 0), datetime(1997, 9, 16, 9, 0)]) + def testStrSetExDateMultiple(self): + rrstr = ("DTSTART:19970902T090000\n" + "RRULE:FREQ=YEARLY;COUNT=6;BYDAY=TU,TH\n" + "EXDATE:19970904T090000,19970911T090000,19970918T090000\n") + + rr = rrulestr(rrstr) + assert list(rr) == [datetime(1997, 9, 2, 9, 0), + datetime(1997, 9, 9, 9, 0), + datetime(1997, 9, 16, 9, 0)] + def testStrSetExDateWithTZID(self): BXL = tz.gettz('Europe/Brussels') rr = rrulestr("DTSTART;TZID=Europe/Brussels:19970902T090000\n" @@ -2987,6 +2997,11 @@ class RRuleTest(WarningTestMixin, unittest.TestCase): self.assertEqual(list(rr), [datetime(1997, 9, 2, 0, 0, 0), datetime(1998, 9, 2, 0, 0, 0)]) + def testStrMultipleDTStartComma(self): + with pytest.raises(ValueError): + rr = rrulestr("DTSTART:19970101T000000,19970202T000000\n" + "RRULE:FREQ=YEARLY;COUNT=1") + def testStrInvalidUntil(self): with self.assertRaises(ValueError): list(rrulestr("DTSTART:19970902T090000\n" |