def test_prettytime_should_return_never(self): """ Verify cases where the prettytime function should return the string 'never' :return: """ self.assertEqual('never', go.prettytime(420)) self.assertEqual('never', go.prettytime(-1))
def test_prettytime_should_return_num_of_months(self): """ Verify case where the prettytime function should return the string number of months :return: """ timestamp = time.time() - (95 * 24 * 3600) self.assertEqual('3 months ago', go.prettytime(timestamp))
def test_prettytime_should_return_yesterday(self): """ Verify case where the prettytime function should return the string 'yesterday' :return: """ timestamp = time.time() - (24 * 3600) self.assertEqual('yesterday', go.prettytime(timestamp))