def describe_seconds(value):
    """
    Convert a seconds value into a human readable (ie week, day, hour) value.
    :param value: integer value of the number of seconds.
    :return: a string with the humanized value.
    """
    return humanize.describe_seconds(value)
示例#2
0
def describe_seconds(value):
    """
    Convert a seconds value into a human readable (ie week, day, hour) value.
    :param value: integer value of the number of seconds.
    :return: a string with the humanized value.
    """
    return humanize.describe_seconds(value)
示例#3
0
 def test_minutes(self):
     self.assertEqual('12m', humanize.describe_seconds(720))
示例#4
0
 def test_seconds(self):
     self.assertEqual('12s', humanize.describe_seconds(12))
示例#5
0
 def test_mix_it_up(self):
     self.assertEqual('2w 3d 14h 42s', humanize.describe_seconds(1519242))
示例#6
0
 def test_all_one(self):
     self.assertEqual('1w 1d 1h 1m 1s', humanize.describe_seconds(694861))
示例#7
0
 def test_weeks(self):
     self.assertEqual('12w', humanize.describe_seconds(7257600))
示例#8
0
 def test_days(self):
     self.assertEqual('5d', humanize.describe_seconds(432000))
示例#9
0
 def test_hours(self):
     self.assertEqual('12h', humanize.describe_seconds(43200))