From 5fed946d721e5ed9a60d23f49c298b38e8c767cd Mon Sep 17 00:00:00 2001 From: Jorrit Schaap <schaap@astron.nl> Date: Mon, 18 Jan 2021 20:07:53 +0100 Subject: [PATCH] TMSS-557: fixed test --- SAS/TMSS/client/lib/tmss_http_rest_client.py | 3 ++- .../test/t_feedback_handling_service.py | 9 ++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/SAS/TMSS/client/lib/tmss_http_rest_client.py b/SAS/TMSS/client/lib/tmss_http_rest_client.py index 121966573a4..7349c268df1 100644 --- a/SAS/TMSS/client/lib/tmss_http_rest_client.py +++ b/SAS/TMSS/client/lib/tmss_http_rest_client.py @@ -354,7 +354,8 @@ class TMSSsession(object): def append_to_subtask_raw_feedback(self, subtask_id: int, feedback: str) -> {}: '''append the raw_feedback for the given subtask, and return the subtask with its new state, or raise an error''' - existing_feedback = self.get_path_as_json_object('/subtask/%s/' % (subtask_id))['raw_feedback'] + subtask = self.get_path_as_json_object('/subtask/%s/' % (subtask_id,)) + existing_feedback = subtask.get('raw_feedback','') if existing_feedback is None or existing_feedback is "": new_feedback = feedback else: diff --git a/SAS/TMSS/services/feedback_handling/test/t_feedback_handling_service.py b/SAS/TMSS/services/feedback_handling/test/t_feedback_handling_service.py index 4a414858756..902a34c7148 100755 --- a/SAS/TMSS/services/feedback_handling/test/t_feedback_handling_service.py +++ b/SAS/TMSS/services/feedback_handling/test/t_feedback_handling_service.py @@ -52,13 +52,12 @@ Observation.DataProducts.Output_Correlated_[0].channelWidth=3051.757812""" @classmethod def setUpClass(cls) -> None: - cls.feedback_listener = TMSSFeedbackListener() - cls.feedback_listener.start_handling() cls.tmss_test_env = TMSSTestEnvironment() cls.tmss_test_env.start() - cls.test_data_creator = TMSSRESTTestDataCreator(cls.tmss_test_env.django_server.url, - (cls.tmss_test_env.ldap_server.dbcreds.user, - cls.tmss_test_env.ldap_server.dbcreds.password)) + cls.test_data_creator = cls.tmss_test_env.create_test_data_creator() + + cls.feedback_listener = TMSSFeedbackListener(rest_client_creds_id=cls.tmss_test_env.client_credentials.dbcreds_id) + cls.feedback_listener.start_handling() @classmethod def tearDownClass(cls) -> None: -- GitLab