Exemplo n.º 1
0
def test_total_flex_as_str_more_than_one_hour() -> None:
    ts = Timesheet()
    ts.get_day("2020-07-01").flex_minutes = 63
    main.DATAFILE = "2020-07-timesheet.json"
    save_timesheet(ts)

    assert total_flex_as_str() == "1h 3min"
Exemplo n.º 2
0
def test_monthly_flextime() -> None:
    ts = Timesheet()
    ts.get_day("2020-07-09").flex_minutes = 38
    ts.get_day("2020-07-10").flex_minutes = 2
    ts.get_day("2020-07-11").flex_minutes = 2

    assert ts.monthly_flex == 42

    save_timesheet(ts)
    ts = load_timesheet()

    assert ts.monthly_flex == 42
Exemplo n.º 3
0
def test_total_flextime() -> None:
    ts = Timesheet()
    ts.get_day("2020-07-01").flex_minutes = 2
    main.DATAFILE = "2020-07-timesheet.json"
    save_timesheet(ts)

    ts = Timesheet()
    ts.get_day("2020-08-01").flex_minutes = 3
    main.DATAFILE = "2020-08-timesheet.json"
    save_timesheet(ts)

    assert calc_total_flex() == 5