Skip to content
Snippets Groups Projects
Commit 5deb4954 authored by Roy de Goei's avatar Roy de Goei Committed by Jorrit Schaap
Browse files

TMSS-178: Rename some test functions

parent c40df214
No related branches found
No related tags found
1 merge request!124Resolve TMSS-178
......@@ -151,7 +151,7 @@ class SubtaskValidationTest(unittest.TestCase):
# POST and GET a new item and assert correctness
r_dict = POST_and_assert_expected_response(self, BASE_URL + '/subtask/', subtask_test_data, 201, subtask_test_data)
url = r_dict['url']
GET_and_assert_equal_expected_response(self, url, 200, subtask_test_data)
GET_OK_and_assert_equal_expected_response(self, url, subtask_test_data)
def test_validate_simple_string_schema_with_invalid_specification_via_rest(self):
template = rest_data_creator.SubtaskTemplate(schema='{"type": "string"}')
......@@ -183,7 +183,7 @@ class SubtaskValidationTest(unittest.TestCase):
# POST and GET a new item and assert correctness
r_dict = POST_and_assert_expected_response(self, BASE_URL + '/subtask/', subtask_test_data, 201, subtask_test_data)
url = r_dict['url']
GET_and_assert_equal_expected_response(self, url, 200, subtask_test_data)
GET_OK_and_assert_equal_expected_response(self, url, subtask_test_data)
def test_validate_correlator_schema_with_invalid_specification_via_rest(self):
# fetch correlator_schema for Dupplo UC1 which should be in the initially populated database
......
This diff is collapsed.
This diff is collapsed.
......@@ -120,22 +120,10 @@ def GET_and_assert_equal_expected_code(test_instance, url, expected_code):
return r_dict
def GET_and_assert_in_expected_response(test_instance, url, expected_content):
"""
GET from url and assert the expected code is returned and the expected content is in the response content
Because of the objects can not be compared with some objects check the keys only
"""
r_dict = _call_API_and_assert_expected_response(test_instance, url, 'GET', {}, 200, None)
for key in expected_content.keys():
test_instance.assertIn(key, r_dict.keys())
assertDataWithUrls(test_instance, r_dict, expected_content)
return r_dict
def GET_and_assert_in_expected_response_result_list(test_instance, url, expected_content, expected_nbr_results):
"""
GET from url and assert the expected code is returned and the expected content is in the response content
Use this when multiple results are returned
Use this check when multiple results (list) are returned
"""
r_dict = _call_API_and_assert_expected_response(test_instance, url, 'GET', {}, 200, None)
if expected_nbr_results > 50:
......@@ -160,11 +148,13 @@ def GET_and_assert_in_expected_response_result_list(test_instance, url, expected
return r_dict
def GET_and_assert_equal_expected_response(test_instance, url, expected_code, expected_content):
def GET_OK_and_assert_equal_expected_response(test_instance, url, expected_content):
"""
GET from url and assert the expected code is returned and the expected content is equal the response content
assertDataWithUrls is already checked in _call_API_and_assert_expected_response
"""
r_dict = _call_API_and_assert_expected_response(test_instance, url, 'GET', {}, expected_code, expected_content)
r_dict = _call_API_and_assert_expected_response(test_instance, url, 'GET', {}, 200, expected_content)
# assertDataWithUrls(test_instance, r_dict, expected_content)
return r_dict
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment