def test_total_worked_hours_with_null_start_date(): start = None t = create_task() r = Recorder() r.add(t) with pytest.raises(Exception): r.total_worked_hours(start)
def test_total_worked_hours_with_future_start_date(): start = datetime(2200, 1, 1) t = create_task() r = Recorder() r.add(t) with pytest.raises(Exception): r.total_worked_hours(start)
def test_total_worked_hours_with_expected_date(): start = datetime(2018, 1, 1) t = create_task() r = Recorder() r.add(t) actual_result = r.total_worked_hours(start) expected_result = 1.0 assert expected_result == actual_result
def test_total_worked_hours_without_record(): start = datetime(2015, 1, 1) r = Recorder() with pytest.raises(Exception): r.total_worked_hours(start)