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

Method testSetExRuleCount

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

Source from the content-addressed store, hash-verified

4812 self.assertEqual(rrset.count(), 7)
4813
4814 def testSetExRuleCount(self):
4815 # Test that the count is updated when an exrule is added
4816 rrset = rruleset(cache=False)
4817 for cache in (True, False):
4818 rrset = rruleset(cache=cache)
4819 rrset.rrule(rrule(YEARLY, count=2, byweekday=TH,
4820 dtstart=datetime(1983, 4, 1)))
4821 rrset.rrule(rrule(WEEKLY, count=4, byweekday=FR,
4822 dtstart=datetime(1991, 6, 3)))
4823
4824 # Check the length twice - first one sets a cache, second reads it
4825 self.assertEqual(rrset.count(), 6)
4826 self.assertEqual(rrset.count(), 6)
4827
4828 # This should invalidate the cache and force an update
4829 rrset.exrule(rrule(WEEKLY, count=2, interval=2,
4830 dtstart=datetime(1991, 6, 14)))
4831
4832 self.assertEqual(rrset.count(), 4)
4833 self.assertEqual(rrset.count(), 4)
4834
4835 def testSetExDateCount(self):
4836 # 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