| 4764 | datetime(1997, 9, 9, 9, 0)]) |
| 4765 | |
| 4766 | def testSetRRuleCount(self): |
| 4767 | # Test that the count is updated when an rrule is added |
| 4768 | rrset = rruleset(cache=False) |
| 4769 | for cache in (True, False): |
| 4770 | rrset = rruleset(cache=cache) |
| 4771 | rrset.rrule(rrule(YEARLY, count=2, byweekday=TH, |
| 4772 | dtstart=datetime(1983, 4, 1))) |
| 4773 | rrset.rrule(rrule(WEEKLY, count=4, byweekday=FR, |
| 4774 | dtstart=datetime(1991, 6, 3))) |
| 4775 | |
| 4776 | # Check the length twice - first one sets a cache, second reads it |
| 4777 | self.assertEqual(rrset.count(), 6) |
| 4778 | self.assertEqual(rrset.count(), 6) |
| 4779 | |
| 4780 | # This should invalidate the cache and force an update |
| 4781 | rrset.rrule(rrule(MONTHLY, count=3, dtstart=datetime(1994, 1, 3))) |
| 4782 | |
| 4783 | self.assertEqual(rrset.count(), 9) |
| 4784 | self.assertEqual(rrset.count(), 9) |
| 4785 | |
| 4786 | def testSetRDateCount(self): |
| 4787 | # Test that the count is updated when an rdate is added |