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

Method testSetExDateCount

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

Source from the content-addressed store, hash-verified

4833 self.assertEqual(rrset.count(), 4)
4834
4835 def testSetExDateCount(self):
4836 # Test that the count is updated when an rdate is added
4837 for cache in (True, False):
4838 rrset = rruleset(cache=cache)
4839 rrset.rrule(rrule(YEARLY, count=2, byweekday=TH,
4840 dtstart=datetime(1983, 4, 1)))
4841 rrset.rrule(rrule(WEEKLY, count=4, byweekday=FR,
4842 dtstart=datetime(1991, 6, 3)))
4843
4844 # Check the length twice - first one sets a cache, second reads it
4845 self.assertEqual(rrset.count(), 6)
4846 self.assertEqual(rrset.count(), 6)
4847
4848 # This should invalidate the cache and force an update
4849 rrset.exdate(datetime(1991, 6, 28))
4850
4851 self.assertEqual(rrset.count(), 5)
4852 self.assertEqual(rrset.count(), 5)
4853
4854
4855class WeekdayTest(unittest.TestCase):

Callers

nothing calls this directly

Calls 5

rrulesetClass · 0.90
rruleClass · 0.90
rruleMethod · 0.80
countMethod · 0.80
exdateMethod · 0.80

Tested by

no test coverage detected