示例#1
0
 def test_hours(self):
     eq_((1, 0, 0), seconds_to_hms(3600))
     eq_((1, 0, 2), seconds_to_hms(3602))
     eq_((2, 0, 0), seconds_to_hms(7200))
     eq_((2, 2, 0), seconds_to_hms(7320))
     eq_((2, 2, 1), seconds_to_hms(7321))
     eq_((2, 2, 2), seconds_to_hms(7322))
示例#2
0
 def test_hours(self):
     assert (1, 0, 0) == seconds_to_hms(3600)
     assert (1, 0, 2) == seconds_to_hms(3602)
     assert (2, 0, 0) == seconds_to_hms(7200)
     assert (2, 2, 0) == seconds_to_hms(7320)
     assert (2, 2, 1) == seconds_to_hms(7321)
     assert (2, 2, 2) == seconds_to_hms(7322)
示例#3
0
 def test_days(self):
     # NOTE: Represents times greater than one day as more than 24 hours
     eq_((25, 0, 1), seconds_to_hms(90001))
示例#4
0
 def test_minutes(self):
     eq_((0, 1, 1), seconds_to_hms(61))
     eq_((0, 1, 0), seconds_to_hms(60))
     eq_((0, 2, 0), seconds_to_hms(120))
示例#5
0
 def test_seconds(self):
     eq_((0, 0, 15), seconds_to_hms(15))
     eq_((0, 0, 1),  seconds_to_hms(1))
示例#6
0
 def test_minutes(self):
     assert (0, 1, 1) == seconds_to_hms(61)
     assert (0, 1, 0) == seconds_to_hms(60)
     assert (0, 2, 0) == seconds_to_hms(120)
示例#7
0
 def test_seconds(self):
     assert (0, 0, 15) == seconds_to_hms(15)
     assert (0, 0, 1) == seconds_to_hms(1)