Skip to content
Snippets Groups Projects
Commit f81a7d3b authored by Roy de Goei's avatar Roy de Goei
Browse files

TMSS-154: Fix in unitttest, taking 'history' into account and determine the...

TMSS-154: Fix in unitttest, taking 'history' into account and determine the total of subtasks objects in stead of hardcoded number
parent abca51d9
Branches
Tags
1 merge request!103Resolve TMSS-154
......@@ -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()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment