diff --git a/SAS/TMSS/backend/test/t_scheduling.py b/SAS/TMSS/backend/test/t_scheduling.py index 226e646d58305000c249d55c3d23f1ef215de656..198ddf9b925f11a0b3272fb229078f16d5cb6b62 100755 --- a/SAS/TMSS/backend/test/t_scheduling.py +++ b/SAS/TMSS/backend/test/t_scheduling.py @@ -145,14 +145,14 @@ class SchedulingTest(unittest.TestCase): def _create_target_observation_subtask(specification_doc: dict=None) -> dict: '''create a target observation subtask in defined state and return the subtask as json dict. if the given specification_doc is None, then the defaults are used.''' + if specification_doc is None: + specification_doc = {'stations': {'digital_pointings': [{'name': 'target0', 'subbands': [0]}], 'station_list': ['CS001', 'CS002', 'CS003']}} + with tmss_test_env.create_tmss_client() as client: task_blueprint_data = test_data_creator.TaskBlueprint(template_url=client.get_task_template(name="target observation")['url']) task_blueprint_data['specifications_doc']['SAPs'][0]['name'] = specification_doc['stations']['digital_pointings'][0]['name'] task_blueprint = test_data_creator.post_data_and_get_response_as_json_object(task_blueprint_data, '/task_blueprint/') - if specification_doc is None: - specification_doc = {} - subtask_template = client.get_subtask_template("observation control") specification_doc = add_defaults_to_json_object_for_schema(specification_doc, subtask_template['schema']) cluster_url = client.get_path_as_json_object('/cluster/1')['url'] @@ -311,7 +311,7 @@ class SchedulingTest(unittest.TestCase): def test_schedule_observation_subtask_with_blocking_reservations_failed(self): """ - Set (Resource Assigner) station CS001, CS002, CS401, CS501 to reserved + Set (Resource Assigner) station CS001, CS002, CS401 to reserved Schedule subtask with stations CS001, CS002, CS401 Check if schedule of the subtask fail """ @@ -338,9 +338,9 @@ class SchedulingTest(unittest.TestCase): def test_schedule_observation_subtask_with_blocking_reservation_ok(self): """ - Set (Resource Assigner) station CS001 to reserved + Set (Resource Assigner) station CS001, CS003 to reserved Schedule subtask with station CS001, CS002, CS003 - Check if schedule of the subtasks do not fail (it can schedule with station CS002 and CS003) + Check if schedule of the subtasks do not fail (it can schedule with station CS002) """ self.assertTrue(create_reserved_stations_for_testing(['CS001','CS003']))