Loading TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceIdentity/064_01.robot 0 → 100644 +14 −0 Changes for TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceIdentity/064_01.robot: 14 added lines, 0 removed lines. Original line number Diff line number Diff line *** Settings *** Documentation Check that one can retrieve the identity of the Context Source: a ContextSourceIdentity Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource Resource ${EXECDIR}/resources/AssertionUtils.resource *** Test Cases *** 064_01_01 Retrieve The Context Source Identity [Documentation] Check that the Context Source identity has an id, its type, an alias, an uptime and the time at the Context Source [Tags] csi-retrieve core_15_2 core_5_2_6_5_6 http_12_2_3_1 ${response}= Retrieve Context Source Identity Check Response Status Code 200 ${response.status_code} Check Response Body Containing ContextSourceIdentity element ${response.json()} doc/analysis/checks.py +14 −0 Changes for doc/analysis/checks.py: 14 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -44,6 +44,8 @@ class Checks: Checks.check_response_body_containing_context_source_registration_element, 'Check Response Body Containing EntityTypeList element': Checks.check_response_body_containing_entitytypelist_element, 'Check Response Body Containing ContextSourceIdentity element': Checks.check_response_body_containing_contextsourceidentity_element, 'Check Response Body Containing EntityType element': Checks.check_response_body_containing_entitytype_element, 'Check Response Body Containing EntityTypeInfo element': Loading Loading @@ -255,6 +257,10 @@ class Checks: 'params': ['filename', 'response'], 'position': [0, 1] }, 'Check Response Body Containing ContextSourceIdentity element': { 'params': ['response_body'], 'position': [0] }, 'Check Response Body Containing EntityType element': { 'params': ['filename', 'response'], 'position': [0, 1] Loading Loading @@ -827,6 +833,14 @@ class Checks: else: raise Exception(f"ERROR, expected filename and response attributes, but received: {kwargs}") @staticmethod def check_response_body_containing_contextsourceidentity_element(kwargs: list) -> str: if 'response_body' in kwargs: return ("Response Body containing a ContextSourceIdentity element: id a URI, type 'ContextSourceIdentity', " "contextSourceAlias not empty, contextSourceUptime a duration, contextSourceTimeAt a DateTime") else: raise Exception(f"ERROR, expected response_body attribute, but received: {kwargs}") @staticmethod def check_response_body_containing_entitytype_element(kwargs: list) -> str: if 'filename' in kwargs and 'response' in kwargs: Loading doc/analysis/generaterobotdata.py +1 −0 Changes for doc/analysis/generaterobotdata.py: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -93,6 +93,7 @@ class GenerateRobotData: 'RegistrationSubscription/CSRegistrationSubscriptionNotificationBehaviour': 'REGSUB', 'RegistrationSUBBehaviour': 'REGSUB', 'Discovery/RetrieveCSRegistration': 'DISC', 'Discovery/RetrieveContextSourceIdentity': 'DISC', 'Discovery/QueryCSRegistrations': 'DISC', 'CommonResponses/VerifyLdContextNotAvailable': 'HTTP', 'CommonResponses/VerifyMergePatchJson': 'HTTP', Loading doc/analysis/requests.py +13 −0 Changes for doc/analysis/requests.py: 13 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -90,6 +90,10 @@ class Requests: 'positions': [0], 'params': ['attribute_name'] }, 'Retrieve Context Source Identity': { 'positions': [], 'params': ['accept'] }, 'Retrieve Entity Type': { 'positions': [0, 1], 'params': ['type', 'context'] Loading Loading @@ -343,6 +347,8 @@ class Requests: Requests.append_entity_attributes_with_parameters, 'Retrieve Attribute': Requests.retrieve_attribute, 'Retrieve Context Source Identity': Requests.retrieve_context_source_identity, 'Retrieve Entity Type': Requests.retrieve_entity_type, 'Query Entities': Loading Loading @@ -1347,6 +1353,13 @@ class Requests: return response @staticmethod def retrieve_context_source_identity(kwargs) -> str: response = "Retrieve Context Source Identity" if 'accept' in kwargs and kwargs['accept'] not in ('', '${EMPTY}'): response = f"{response}, with Header['Accept'] set to '{kwargs['accept']}'" return response @staticmethod def retrieve_attribute(kwargs) -> str: if 'attribute_name' in kwargs: Loading resources/ApiUtils/ContextSourceDiscovery.resource +14 −0 Changes for resources/ApiUtils/ContextSourceDiscovery.resource: 14 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -162,3 +162,17 @@ Retrieve Context Source Registration ... expected_status=any Output ${response} Retrieve Context Source Registration RETURN ${response} Retrieve Context Source Identity [Documentation] GET /info/sourceIdentity [Tags] actor_context-consumer [Arguments] ${accept}=${EMPTY} &{headers}= Create Dictionary IF '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} ${response}= GET ... url=${url}${NGSI_LD_API_PATH}/info/sourceIdentity ... headers=${headers} ... expected_status=any Output ${response} Retrieve Context Source Identity RETURN ${response} Loading
TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceIdentity/064_01.robot 0 → 100644 +14 −0 Changes for TP/NGSI-LD/ContextSource/Discovery/RetrieveContextSourceIdentity/064_01.robot: 14 added lines, 0 removed lines. Original line number Diff line number Diff line *** Settings *** Documentation Check that one can retrieve the identity of the Context Source: a ContextSourceIdentity Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource Resource ${EXECDIR}/resources/AssertionUtils.resource *** Test Cases *** 064_01_01 Retrieve The Context Source Identity [Documentation] Check that the Context Source identity has an id, its type, an alias, an uptime and the time at the Context Source [Tags] csi-retrieve core_15_2 core_5_2_6_5_6 http_12_2_3_1 ${response}= Retrieve Context Source Identity Check Response Status Code 200 ${response.status_code} Check Response Body Containing ContextSourceIdentity element ${response.json()}
doc/analysis/checks.py +14 −0 Changes for doc/analysis/checks.py: 14 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -44,6 +44,8 @@ class Checks: Checks.check_response_body_containing_context_source_registration_element, 'Check Response Body Containing EntityTypeList element': Checks.check_response_body_containing_entitytypelist_element, 'Check Response Body Containing ContextSourceIdentity element': Checks.check_response_body_containing_contextsourceidentity_element, 'Check Response Body Containing EntityType element': Checks.check_response_body_containing_entitytype_element, 'Check Response Body Containing EntityTypeInfo element': Loading Loading @@ -255,6 +257,10 @@ class Checks: 'params': ['filename', 'response'], 'position': [0, 1] }, 'Check Response Body Containing ContextSourceIdentity element': { 'params': ['response_body'], 'position': [0] }, 'Check Response Body Containing EntityType element': { 'params': ['filename', 'response'], 'position': [0, 1] Loading Loading @@ -827,6 +833,14 @@ class Checks: else: raise Exception(f"ERROR, expected filename and response attributes, but received: {kwargs}") @staticmethod def check_response_body_containing_contextsourceidentity_element(kwargs: list) -> str: if 'response_body' in kwargs: return ("Response Body containing a ContextSourceIdentity element: id a URI, type 'ContextSourceIdentity', " "contextSourceAlias not empty, contextSourceUptime a duration, contextSourceTimeAt a DateTime") else: raise Exception(f"ERROR, expected response_body attribute, but received: {kwargs}") @staticmethod def check_response_body_containing_entitytype_element(kwargs: list) -> str: if 'filename' in kwargs and 'response' in kwargs: Loading
doc/analysis/generaterobotdata.py +1 −0 Changes for doc/analysis/generaterobotdata.py: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -93,6 +93,7 @@ class GenerateRobotData: 'RegistrationSubscription/CSRegistrationSubscriptionNotificationBehaviour': 'REGSUB', 'RegistrationSUBBehaviour': 'REGSUB', 'Discovery/RetrieveCSRegistration': 'DISC', 'Discovery/RetrieveContextSourceIdentity': 'DISC', 'Discovery/QueryCSRegistrations': 'DISC', 'CommonResponses/VerifyLdContextNotAvailable': 'HTTP', 'CommonResponses/VerifyMergePatchJson': 'HTTP', Loading
doc/analysis/requests.py +13 −0 Changes for doc/analysis/requests.py: 13 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -90,6 +90,10 @@ class Requests: 'positions': [0], 'params': ['attribute_name'] }, 'Retrieve Context Source Identity': { 'positions': [], 'params': ['accept'] }, 'Retrieve Entity Type': { 'positions': [0, 1], 'params': ['type', 'context'] Loading Loading @@ -343,6 +347,8 @@ class Requests: Requests.append_entity_attributes_with_parameters, 'Retrieve Attribute': Requests.retrieve_attribute, 'Retrieve Context Source Identity': Requests.retrieve_context_source_identity, 'Retrieve Entity Type': Requests.retrieve_entity_type, 'Query Entities': Loading Loading @@ -1347,6 +1353,13 @@ class Requests: return response @staticmethod def retrieve_context_source_identity(kwargs) -> str: response = "Retrieve Context Source Identity" if 'accept' in kwargs and kwargs['accept'] not in ('', '${EMPTY}'): response = f"{response}, with Header['Accept'] set to '{kwargs['accept']}'" return response @staticmethod def retrieve_attribute(kwargs) -> str: if 'attribute_name' in kwargs: Loading
resources/ApiUtils/ContextSourceDiscovery.resource +14 −0 Changes for resources/ApiUtils/ContextSourceDiscovery.resource: 14 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -162,3 +162,17 @@ Retrieve Context Source Registration ... expected_status=any Output ${response} Retrieve Context Source Registration RETURN ${response} Retrieve Context Source Identity [Documentation] GET /info/sourceIdentity [Tags] actor_context-consumer [Arguments] ${accept}=${EMPTY} &{headers}= Create Dictionary IF '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} ${response}= GET ... url=${url}${NGSI_LD_API_PATH}/info/sourceIdentity ... headers=${headers} ... expected_status=any Output ${response} Retrieve Context Source Identity RETURN ${response}