MCPcopy Create free account
hub / github.com/dateutil/dateutil / testStrWithTZIDCallable

Method testStrWithTZIDCallable

tests/test_rrule.py:2706–2723  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2704 self.assertEqual(list(rr), exp)
2705
2706 def testStrWithTZIDCallable(self):
2707 rrstr = ('DTSTART;TZID=UTC+04:19970902T090000\n' +
2708 'RRULE:FREQ=YEARLY;COUNT=3')
2709
2710 TZ = tz.tzstr('UTC+04')
2711 def parse_tzstr(tzstr):
2712 if tzstr is None:
2713 raise ValueError('Invalid tzstr')
2714
2715 return tz.tzstr(tzstr)
2716
2717 rr = rrulestr(rrstr, tzids=parse_tzstr)
2718
2719 exp = [datetime(1997, 9, 2, 9, 0, tzinfo=TZ),
2720 datetime(1998, 9, 2, 9, 0, tzinfo=TZ),
2721 datetime(1999, 9, 2, 9, 0, tzinfo=TZ),]
2722
2723 self.assertEqual(list(rr), exp)
2724
2725 def testStrWithTZIDCallableFailure(self):
2726 rrstr = ('DTSTART;TZID=America/New_York:19970902T090000\n' +

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected