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

Method testSetExRuleCount

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

Source from the content-addressed store, hash-verified

4804 self.assertEqual(rrset.count(), 7)
4805
4806 def testSetExRuleCount(self):
4807 # Test that the count is updated when an exrule is added
4808 rrset = rruleset(cache=False)
4809 for cache in (True, False):
4810 rrset = rruleset(cache=cache)
4811 rrset.rrule(rrule(YEARLY, count=2, byweekday=TH,
4812 dtstart=datetime(1983, 4, 1)))
4813 rrset.rrule(rrule(WEEKLY, count=4, byweekday=FR,
4814 dtstart=datetime(1991, 6, 3)))
4815
4816 # Check the length twice - first one sets a cache, second reads it
4817 self.assertEqual(rrset.count(), 6)
4818 self.assertEqual(rrset.count(), 6)
4819
4820 # This should invalidate the cache and force an update
4821 rrset.exrule(rrule(WEEKLY, count=2, interval=2,
4822 dtstart=datetime(1991, 6, 14)))
4823
4824 self.assertEqual(rrset.count(), 4)
4825 self.assertEqual(rrset.count(), 4)
4826
4827 def testSetExDateCount(self):
4828 # Test that the count is updated when an rdate is added

Callers

nothing calls this directly

Calls 5

rrulesetClass · 0.90
rruleClass · 0.90
rruleMethod · 0.80
countMethod · 0.80
exruleMethod · 0.80

Tested by

no test coverage detected