| 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 |