def testOneDayLeft(self): self.showColumn('timeLeft') timeLeft = date.TimeDelta(hours=25, seconds=30) self.taskList.append(self.task) self.task.setDueDateTime(date.Now() + timeLeft) self.assertEqual(render.timeLeft(timeLeft, False), self.getItemText(0, 3))
def testNoTimeLeftWhenCompleted(self): self.assertEqual('', render.timeLeft(date.TimeDelta(), True))
def testNoTimeLeftWhenActive(self): timeLeft = date.TimeDelta() self.assertEqual('0:00', render.timeLeft(timeLeft, False))
def testOneDayHourWhenCompleted(self): timeLeft = -date.ONE_HOUR self.assertEqual('', render.timeLeft(timeLeft, True))
def testOneHourLateWhenActive(self): timeLeft = -date.ONE_HOUR self.assertEqual('-1:00', render.timeLeft(timeLeft, False))
def testOneDayLateWhenCompleted(self): timeLeft = date.TimeDelta(days=-1) self.assertEqual('', render.timeLeft(timeLeft, True))
def testOneDayLateWhenActive(self): timeLeft = date.TimeDelta(days=-1) self.assertEqual('-1 day, 0:00', render.timeLeft(timeLeft, False))
def testTwoDaysLeftWhenCompleted(self): timeLeft = date.TimeDelta(days=2) self.assertEqual('', render.timeLeft(timeLeft, True))
def testTwoDaysLeftWhenActive(self): timeLeft = date.TimeDelta(days=2) self.assertEqual('2 days, 0:00', render.timeLeft(timeLeft, False))
def testInfiniteTimeLeftWhenCompleted(self): self.assertEqual('', render.timeLeft(date.TimeDelta.max, True))
def testNoTimeLeftWhenNoDueDate(self): self.assertEqual('', render.timeLeft(date.TimeDelta.max, False))