def test_returns_none_for_invalid_line(self): line = "Invalid line" date = hours_input.parsedate(line) starttime = hours_input.parsestarttime(line) endtime = hours_input.parseendtime(line) assert date == None assert starttime == None assert endtime == None
def test_can_parse_startandendtime_from_line(self): line = "12/18/12 In: 09:23 Out: 17:45" starttime = hours_input.parsestarttime(line) endtime = hours_input.parseendtime(line) assert starttime == datetime.time(9, 23, 0) assert endtime == datetime.time(17, 45, 0)
def test_can_parse_endtime_from_single_line(self): line = "12/18/12 In: 09:00 Out: 17:00" endtime = hours_input.parseendtime(line) assert endtime == datetime.time(17, 0, 0)