def testCompositePatternMatches(self):
     c = CompositePattern()
     c.add(YearPattern(2004))
     c.add(MonthPattern(3))
     c.add(DayPattern(24))
     d = datetime.date(2004, 3, 24)
     self.failUnless(c.matches(d))
 def testYearMatches(self):
     y = YearPattern(2004)
     d = datetime.date(2004, 3, 14)
     self.failUnless(y.matches(d))
 def testYearMatches(self):
     y = YearPattern(2004)
     d = datetime.date(2004,3,14)
     self.failUnless(y.matches(d))
 def testYearDoesntMatch(self):
     y = YearPattern(2003)
     d = datetime.date(2004, 3, 14)
     self.failIf(y.matches(d))
 def testYearDoesntMatch(self):
     y = YearPattern(2003)
     d = datetime.date(2004,3,14)
     self.failIf(y.matches(d))