Skip to content
Snippets Groups Projects
Commit 20a6867d authored by Mario Raciti's avatar Mario Raciti
Browse files

TMSS-655: Fix _create_target_observation_subtask default parameter

parent 39823872
Branches
Tags
4 merge requests!634WIP: COBALT commissioning delta,!512From master into TMSS-849-Commissioning-sprint-9,!509Resolve TMSS-655,!481Draft: SW-971 SW-973 SW-975: Various fixes to build LOFAR correctly.
...@@ -145,14 +145,14 @@ class SchedulingTest(unittest.TestCase): ...@@ -145,14 +145,14 @@ class SchedulingTest(unittest.TestCase):
def _create_target_observation_subtask(specification_doc: dict=None) -> dict: 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. '''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 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: 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 = 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_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/') 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") subtask_template = client.get_subtask_template("observation control")
specification_doc = add_defaults_to_json_object_for_schema(specification_doc, subtask_template['schema']) 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'] cluster_url = client.get_path_as_json_object('/cluster/1')['url']
...@@ -311,7 +311,7 @@ class SchedulingTest(unittest.TestCase): ...@@ -311,7 +311,7 @@ class SchedulingTest(unittest.TestCase):
def test_schedule_observation_subtask_with_blocking_reservations_failed(self): 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 Schedule subtask with stations CS001, CS002, CS401
Check if schedule of the subtask fail Check if schedule of the subtask fail
""" """
...@@ -338,9 +338,9 @@ class SchedulingTest(unittest.TestCase): ...@@ -338,9 +338,9 @@ class SchedulingTest(unittest.TestCase):
def test_schedule_observation_subtask_with_blocking_reservation_ok(self): 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 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'])) self.assertTrue(create_reserved_stations_for_testing(['CS001','CS003']))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment