示例#1
0
 def testInvalidDateHandling(self):
     parser = TextFileParser()
     try:
         event = parser.parseLine('2012-02-22 - 2012-02-20 : type : Event 1')    
     except ValueError:
         return
     assert False
示例#2
0
 def testParseMultiDayEvent(self):
     parser = TextFileParser()
     event = parser.parseLine('2012-02-21 - 2012-02-22: type : Event 1')
     self.assertEquals('Event 1', event.content)
     self.assertEquals('type', event.type)
     self.assertEquals('2012', event.startYear)
     self.assertEquals('02', event.startMonth)
     self.assertEquals('21', event.startDay)
     self.assertEquals('2012', event.endYear)
     self.assertEquals('02', event.endMonth)
     self.assertEquals('22', event.endDay)