From f896cbf09488966a01ef0b95ca68b54bd1041fd7 Mon Sep 17 00:00:00 2001 From: markus Date: Thu, 5 Nov 2020 16:17:52 +0100 Subject: [PATCH] add test for present_intervals --- cara/tests/apps/calculator/test_model_generator.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cara/tests/apps/calculator/test_model_generator.py b/cara/tests/apps/calculator/test_model_generator.py index 05203273..a13018cc 100644 --- a/cara/tests/apps/calculator/test_model_generator.py +++ b/cara/tests/apps/calculator/test_model_generator.py @@ -23,3 +23,15 @@ def test_ventilation(baseline_form): ventilation = baseline_form.ventilation() # TODO: # assert ventilation == cara.models.Ventilation() + + +def test_present_intervals(baseline_form): + baseline_form.coffee_duration = 15 + baseline_form.coffee_option = True + baseline_form.coffee_breaks = 4 + baseline_form.activity_start = 9 * 60 + baseline_form.activity_finish = 17 * 60 + baseline_form.lunch_start = 12 * 60 + 30 + baseline_form.lunch_finish = 13 * 60 + 30 + correct = ((9, 10), (10.25, 12), (12.25, 12.5), (13.5, 14), (14.25, 16), (16.25, 17)) + assert baseline_form.present_interval().present_times == correct