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

TMSS-189: use schedulable template and spec

parent 2571e953
No related branches found
No related tags found
1 merge request!182Resolve TMSS-189 (and TMSS-192)
...@@ -58,15 +58,19 @@ test_data_creator = TMSSRESTTestDataCreator(tmss_test_env.django_server.url, (tm ...@@ -58,15 +58,19 @@ test_data_creator = TMSSRESTTestDataCreator(tmss_test_env.django_server.url, (tm
class SchedulingTest(unittest.TestCase): class SchedulingTest(unittest.TestCase):
def test_schedule_observation_subtask_with_enough_resources_available(self): def test_schedule_observation_subtask_with_enough_resources_available(self):
subtask_data = test_data_creator.Subtask() with tmss_test_env.create_tmss_client() as client:
subtask_template = client.get_subtask_template("observationcontrol schema")
subtask_data = test_data_creator.Subtask(specifications_template_url=subtask_template['url'],
specifications_doc=get_default_json_object_for_schema(subtask_template['schema']))
subtask = test_data_creator.post_data_and_get_response_as_json_object(subtask_data, '/subtask/') subtask = test_data_creator.post_data_and_get_response_as_json_object(subtask_data, '/subtask/')
subtask_id = subtask['id'] subtask_id = subtask['id']
with tmss_test_env.create_tmss_client() as client:
client.set_subtask_status(subtask_id, 'defined') client.set_subtask_status(subtask_id, 'defined')
client.schedule_subtask(subtask_id) client.schedule_subtask(subtask_id)
if __name__ == "__main__": if __name__ == "__main__":
os.environ['TZ'] = 'UTC' os.environ['TZ'] = 'UTC'
unittest.main() unittest.main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment