Skip to content
Snippets Groups Projects
Commit b5f495a5 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

TMSS-671: fixed test

parent aeac71f4
No related branches found
No related tags found
1 merge request!715TMSS-671 & TMSS-1135 & TMSS-1332
......@@ -810,7 +810,7 @@ class TestDynamicScheduling(BaseDynamicSchedulingTestCase):
self.assertEqual(scheduled_scheduling_unit.status.value, 'scheduled')
self.assertEqual(scheduled_scheduling_unit.scheduled_start_time, at)
@unittest.skip("FIX TEST, skipping it for now, see TODO comment in assign_start_stop_times_to_schedulable_scheduling_units")
def test_three_simple_observations_no_constraints_different_project_priority(self):
scheduling_unit_draft_low = self.create_simple_observation_scheduling_unit("scheduling unit low", scheduling_set=self.scheduling_set_low)
scheduling_unit_blueprint_low = create_scheduling_unit_blueprint_and_tasks_and_subtasks_from_scheduling_unit_draft(scheduling_unit_draft_low)
......@@ -830,20 +830,20 @@ class TestDynamicScheduling(BaseDynamicSchedulingTestCase):
# check the results
# we expect the sub_high to be scheduled
scheduling_unit_blueprint_low.refresh_from_db()
scheduling_unit_blueprint_medium.refresh_from_db()
scheduling_unit_blueprint_high.refresh_from_db()
scheduling_unit_blueprint_high = wait_for_scheduling_unit_blueprint_status(scheduling_unit_blueprint_high.id, models.SchedulingUnitStatus.Choices.SCHEDULED.value)
scheduling_unit_blueprint_medium = wait_for_scheduling_unit_blueprint_status(scheduling_unit_blueprint_medium.id, models.SchedulingUnitStatus.Choices.SCHEDULABLE.value)
scheduling_unit_blueprint_low = wait_for_scheduling_unit_blueprint_status(scheduling_unit_blueprint_low.id, models.SchedulingUnitStatus.Choices.SCHEDULABLE.value)
self.assertEqual(scheduling_unit_blueprint_low.status.value, 'schedulable')
self.assertEqual(scheduling_unit_blueprint_medium.status.value, 'schedulable')
self.assertEqual(scheduling_unit_blueprint_high.status.value, 'scheduled')
# check the scheduled subtask
upcoming_scheduled_subtasks = models.Subtask.objects.filter(state__value='scheduled',
task_blueprints__scheduling_unit_blueprint__in=(scheduling_unit_blueprint_low,
task_blueprint__scheduling_unit_blueprint__in=(scheduling_unit_blueprint_low,
scheduling_unit_blueprint_medium,
scheduling_unit_blueprint_high)).all()
self.assertEqual(1, upcoming_scheduled_subtasks.count())
self.assertEqual(scheduling_unit_blueprint_high.id, upcoming_scheduled_subtasks[0].task_blueprints().first().scheduling_unit_blueprint_cs001.id) # all task blueprints share same SU, so it does not matter which one we check
self.assertEqual(scheduling_unit_blueprint_high.id, upcoming_scheduled_subtasks[0].task_blueprint.scheduling_unit_blueprint.id)
# check scheduling_unit_blueprint_low starts after the scheduled scheduling_unit_blueprint_high
self.assertGreater(scheduling_unit_blueprint_low.scheduled_start_time, scheduling_unit_blueprint_medium.scheduled_start_time)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment