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