def test_parse_time_minutes_out_of_range(): with pytest.raises(ParseError): TimesheetParser.parse_time('-1061')
def test_parse_time_separator_without_timespan(): with pytest.raises(ParseError): TimesheetParser.parse_time('-')
def test_parse_time_invalid_string(): with pytest.raises(ParseError): TimesheetParser.parse_time('foo')
def test_parse_time_hours_out_of_range(): with pytest.raises(ParseError): TimesheetParser.parse_time('-2500')
def test_parse_time_valid_timespan_without_end(): assert TimesheetParser.parse_time('09:00-?') == (datetime.time(9, 0), None)
def test_parse_time_valid_timespan_without_start(): assert TimesheetParser.parse_time('-10:15') == (None, datetime.time(10, 15))
def test_parse_time_valid_timespan_with_separators(): assert TimesheetParser.parse_time('09:00-10:15') == (datetime.time(9, 0), datetime.time(10, 15))
def test_parse_time_valid_timespan(): assert TimesheetParser.parse_time('0900-1015') == (datetime.time(9, 0), datetime.time(10, 15))
def test_parse_time_valid_big_integer(): assert TimesheetParser.parse_time('0900') == 900.0
def test_parse_time_valid_integer(): assert TimesheetParser.parse_time('3') == 3.0
def test_parse_time_valid_decimal(): assert TimesheetParser.parse_time('1.75') == 1.75