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

Method testSetExDateCount

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

Source from the content-addressed store, hash-verified

4825 self.assertEqual(rrset.count(), 4)
4826
4827 def testSetExDateCount(self):
4828 # Test that the count is updated when an rdate is added
4829 for cache in (True, False):
4830 rrset = rruleset(cache=cache)
4831 rrset.rrule(rrule(YEARLY, count=2, byweekday=TH,
4832 dtstart=datetime(1983, 4, 1)))
4833 rrset.rrule(rrule(WEEKLY, count=4, byweekday=FR,
4834 dtstart=datetime(1991, 6, 3)))
4835
4836 # Check the length twice - first one sets a cache, second reads it
4837 self.assertEqual(rrset.count(), 6)
4838 self.assertEqual(rrset.count(), 6)
4839
4840 # This should invalidate the cache and force an update
4841 rrset.exdate(datetime(1991, 6, 28))
4842
4843 self.assertEqual(rrset.count(), 5)
4844 self.assertEqual(rrset.count(), 5)
4845
4846
4847class 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