diff --git a/SAS/TMSS/test/t_tmssapp_scheduling_functional.py b/SAS/TMSS/test/t_tmssapp_scheduling_functional.py index ebe0f0acaccaeaa7e65faaf3ae886074f494f648..925ec5c2455fc24aef25a33acd17d116f3ddbc6e 100755 --- a/SAS/TMSS/test/t_tmssapp_scheduling_functional.py +++ b/SAS/TMSS/test/t_tmssapp_scheduling_functional.py @@ -1349,6 +1349,15 @@ class SubtaskQuery(unittest.TestCase): json_response = response.json() self.assertEqual(expected_count, json_response.get('count')) + @staticmethod + def get_total_number_of_subtasks(): + """ + Retrieve the total number of current subtasks objects + """ + response = requests.get(BASE_URL + '/subtask/', auth=AUTH) + json_response = response.json() + return json_response.get('count') + @staticmethod def create_cluster_object(cluster_name): cluster_data = Cluster_test_data(name=cluster_name) @@ -1512,8 +1521,10 @@ class SubtaskQuery(unittest.TestCase): response = requests.get(BASE_URL + '/subtask/?cluster__name=clusterNotExist', auth=AUTH) self.check_response_OK_and_result_count(response, 0) + # Check how many is 'ALL' + total_subtasks = SubtaskQuery.get_total_number_of_subtasks() response = requests.get(BASE_URL + '/subtask/?cluster__error_in_query=clusterA', auth=AUTH) - self.check_response_OK_and_result_count(response, 82) + self.check_response_OK_and_result_count(response, total_subtasks) period_length_in_days = 50 # max(B+C) stop_time = datetime.now()