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

Method testSetRDateCount

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

Source from the content-addressed store, hash-verified

4784 self.assertEqual(rrset.count(), 9)
4785
4786 def testSetRDateCount(self):
4787 # Test that the count is updated when an rdate is added
4788 rrset = rruleset(cache=False)
4789 for cache in (True, False):
4790 rrset = rruleset(cache=cache)
4791 rrset.rrule(rrule(YEARLY, count=2, byweekday=TH,
4792 dtstart=datetime(1983, 4, 1)))
4793 rrset.rrule(rrule(WEEKLY, count=4, byweekday=FR,
4794 dtstart=datetime(1991, 6, 3)))
4795
4796 # Check the length twice - first one sets a cache, second reads it
4797 self.assertEqual(rrset.count(), 6)
4798 self.assertEqual(rrset.count(), 6)
4799
4800 # This should invalidate the cache and force an update
4801 rrset.rdate(datetime(1993, 2, 14))
4802
4803 self.assertEqual(rrset.count(), 7)
4804 self.assertEqual(rrset.count(), 7)
4805
4806 def testSetExRuleCount(self):
4807 # Test that the count is updated when an exrule is added

Callers

nothing calls this directly

Calls 5

rrulesetClass · 0.90
rruleClass · 0.90
rruleMethod · 0.80
countMethod · 0.80
rdateMethod · 0.80

Tested by

no test coverage detected