Beispiel #1
0
t.seconds = 59
t.minutes = 59
assert (t.hours == 0)
assert (t.minutes == 59)
assert (t.seconds == 59)
t.tick()
assert (t.hours == 1)
assert (t.minutes == 0)
assert (t.seconds == 0)

t.seconds = 59
t.minutes = 59
assert (t.hours == 1)
assert (t.minutes == 59)
assert (t.seconds == 59)
t.tick()
assert (t.hours == 2)
assert (t.minutes == 0)
assert (t.seconds == 0)

t.reset()
assert (t.hours == 0)
assert (t.minutes == 0)
assert (t.seconds == 0)

t.hours = 1
t.minutes = 2
t.seconds = 3
assert (t.__str__() == "1h 2m 3s")