def test_formatting_space(): formatting = TimesheetParser.detect_formatting('foobar 4 description') assert formatting['spacer'] == (' ', ' ')
def test_detect_formatting_space_tabs(): formatting = TimesheetParser.detect_formatting('foobar\t4 description') assert formatting['spacer'] == ('\t', ' ')
def test_detect_formatting_time_hours(): formatting = TimesheetParser.detect_formatting('foobar 4 description') assert formatting['time_format'] == '%H%M'
def test_detect_formatting_time_format_separator(): formatting = TimesheetParser.detect_formatting( 'foobar 15:00-16:00 description' ) assert formatting['time_format'] == '%H:%M'
def test_detect_formatting_padded_time_and_alias(): formatting = TimesheetParser.detect_formatting( 'foobar 1500-1600 description' ) assert formatting['width'] == (8, 13)
def test_detect_formatting_padded_time(): formatting = TimesheetParser.detect_formatting( 'foobar 1500-1600 description' ) assert formatting['width'][1] == 13
def test_detect_formatting_padded_alias(): formatting = TimesheetParser.detect_formatting('foobar 4 description') assert formatting['width'][0] == 9