Newer
Older
from datetime import datetime
def test_to_unix_timestamp():
from aosstower.time import to_unix_timestamp
assert to_unix_timestamp(datetime(1970, 1, 1)) == 0
def test_hhmm_to_secs():
assert hhmm_to_offset('2400') == 86400, "Can't handle > 23:59"
assert hhmm_to_offset('2401') == 86460, "Can't handle > 23:59"
assert hhmm_to_offset('0') == 0, "Can't handle short times"
assert hhmm_to_offset('001') == 60, "Can't handle leading 0"