diff options
| author | Kaufmann <Kau@avh.de> | 2025-04-02 11:16:56 +0200 |
|---|---|---|
| committer | Kaufmann <Kau@avh.de> | 2025-04-02 11:16:56 +0200 |
| commit | d62c4b9b194ad6233107cf71a87870441b2b0d4b (patch) | |
| tree | c9934e2f10022e69c38a639500b1fec64105cf8e /test.py | |
Vorstellung des Ausfallzeitenrechners im JF von Abt. 2.5.
Initiale Kritik: Kommentarfeld, speichern als PDF, Datumsformat
Diffstat (limited to 'test.py')
| -rw-r--r-- | test.py | 40 |
1 files changed, 40 insertions, 0 deletions
@@ -0,0 +1,40 @@ +# test.py +from date_calculator import DateCalculator +from calendar_manager import CalendarManager +from prediction_controller import PredictionController + + + +def test_calculate_prediction(): + # Input event dates as strings + event1_str = ["2023-01-01", "2023-01-10"] + event2_str = ["2023-01-05", "2023-01-15"] + + # Input full project dates as strings + project1_str = ["2025-01-02", "2025-02-11"] + + # Input half project dates as strings + project2_str = ["2025-02-01", "2025-06-30"] + project3_str = ["2024-05-05", "2024-06-07"] + + date_calculator = DateCalculator() + calendar_manager = CalendarManager() + prediction_controller = PredictionController(calendar_manager, date_calculator, ["Erziehungszeit 100%", "Erziehungszeit 50%", "Erziehungszeit pauschal", "Sonstige"]) + + calendar_manager.add_entry(event1_str[0], event1_str[1], "Sonstige") + calendar_manager.add_entry(event2_str[0], event2_str[1], "Sonstige") + calendar_manager.add_entry(project1_str[0], project1_str[1], "Erziehungszeit 100%") + calendar_manager.add_entry(project2_str[0], project2_str[1], "Erziehungszeit 50%") + calendar_manager.add_entry(project3_str[0], project3_str[1], "Erziehungszeit 50%") + + # Set launch date and duration + prediction_controller.make_prediction("2023-01-01", 2) + + prediction = prediction_controller.get_prediction() + + # Output the result + print(f"Predicted completion date: {prediction}") + print(calendar_manager.list_entries()) + +# Run the test +test_calculate_prediction()
\ No newline at end of file |
