Commit b7c832db authored by Paul Graydon's avatar Paul Graydon

wendelin_telecom_test: Update tests

parent 9ff9bdc6
......@@ -499,9 +499,13 @@ class WendelinTelecomTest(SecurityTestCase):
tag_enb_id_seed=tag_enb_id_seed
)
# Parse the JSON response and check that it is empty, indicating a success
# Parse the JSON response and check that it indicates a success
response_dict = json.loads(ors_item_dict['response'])
self.assertTrue(response_dict == {})
self.assertTrue(response_dict['status'] == "ok")
self.assertTrue(
response_dict['message'] == "ORS with tag %s successfully registered." \
% ors_item_dict['data_acquisition_unit'].getReference()
)
# Check that the Data Acquisition Unit and Data Supply have been created
self.assertTrue(ors_item_dict['data_acquisition_unit'] is not None)
......@@ -515,10 +519,13 @@ class WendelinTelecomTest(SecurityTestCase):
tag_enb_id_seed=tag_enb_id_seed
)
# Parse the JSON response and check the error message
# Parse the JSON response and check the status and message
response_dict = json.loads(repeated_ors_item_dict['response'])
self.assertTrue('error_msg' in response_dict)
self.assertTrue(response_dict['error_msg'] == "ORS with tag %s already exists." % ors_item_dict['data_acquisition_unit'].getReference())
self.assertTrue(response_dict['status'] == "ok")
self.assertTrue(
response_dict['message'] == "ORS with tag %s already exists." \
% ors_item_dict['data_acquisition_unit'].getReference()
)
# Now, link the original Data Supply to a client project
project_a_item_dict = self.registerOrsClientProject()
......@@ -572,9 +579,13 @@ class WendelinTelecomTest(SecurityTestCase):
tag_enb_id_seed=''
)
# Parse the JSON response and check that it is empty, indicating a success
# Parse the JSON response and check that it indicates a success
response_dict = json.loads(no_enb_id_ors_item_dict['response'])
self.assertTrue(response_dict == {})
self.assertTrue(response_dict['status'] == "ok")
self.assertTrue(
response_dict['message'] == "ORS with tag %s successfully registered." \
% no_enb_id_ors_item_dict['data_acquisition_unit'].getReference()
)
# Check that the Data Acquisition Unit and Data Supply have been created
self.assertTrue(no_enb_id_ors_item_dict['data_acquisition_unit'] is not None)
......@@ -602,9 +613,11 @@ class WendelinTelecomTest(SecurityTestCase):
# Parse the JSON response and check the error message
response_dict = json.loads(too_long_tag_ors_item_dict['response'])
self.assertTrue('error_msg' in response_dict)
self.assertTrue(response_dict['error_msg'] == "Invalid ORS tag ors%s_COMP-%s_e0x%sTest found" \
% (too_long_tag_hostname_seed, tag_comp_id_seed, tag_enb_id_seed))
self.assertTrue(response_dict['status'] == "error")
self.assertTrue(
response_dict['message'] == "Invalid ORS tag ors%s_COMP-%s_e0x%sTest found" \
% (too_long_tag_hostname_seed, tag_comp_id_seed, tag_enb_id_seed)
)
# Check that the Data Acquisition Unit and Data Supply have NOT been created
self.assertTrue(too_long_tag_ors_item_dict['data_acquisition_unit'] is None)
......@@ -620,8 +633,8 @@ class WendelinTelecomTest(SecurityTestCase):
# Parse the JSON response and check the error message
response_dict = json.loads(too_long_tag_ors_item_dict['response'])
self.assertTrue('error_msg' in response_dict)
self.assertTrue(response_dict['error_msg'] == "Invalid ORS tag ors%sTest found" % tag_hostname_seed)
self.assertTrue(response_dict['status'] == "error")
self.assertTrue(response_dict['message'] == "Invalid ORS tag ors%sTest found" % tag_hostname_seed)
# Check that the Data Acquisition Unit and Data Supply have NOT been created
self.assertTrue(too_long_tag_ors_item_dict['data_acquisition_unit'] is None)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment