def test4(): "Calculate time to wait between now and some later departure time." now = datetime.datetime(2012, 1, 1, 18, 0, 0) dep = datetime.datetime(2012, 1, 1, 18, 2, 0) wait = vbbvg.wait_time(dep.strftime('%H:%M'), now=now) assert wait == '02:00'
def test6(): "Calculate time to wait between now and some later departure time." now = datetime.datetime(2012, 1, 1, 18, 30, 30) dep = datetime.datetime(2012, 1, 1, 19, 45, 0) wait = vbbvg.wait_time(dep.strftime('%H:%M'), now=now) assert wait == '01:14:30'
def test3(): "Calculate time to wait between now and some later departure time." delta_secs = 10 now = datetime.datetime(2012, 1, 1, 18, 0, 0) dep = datetime.datetime(2012, 1, 1, 18, 0, delta_secs) wait = vbbvg.wait_time(dep.strftime('%H:%M'), now=now) assert wait == '00:00'