Loading TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_07.robot +5 −5 Original line number Diff line number Diff line Loading @@ -6,8 +6,8 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Suite Setup Setup Entities Suite Teardown Delete Entities Suite Setup Setup Initial Entities Suite Teardown Delete Initial Entities Test Template Check that the total number of matching results is returned if the count parameter is set to true Loading Loading @@ -38,9 +38,9 @@ Check that the total number of matching results is returned if the count paramet ... context=${ngsild_test_suite_context} Check Response Status Code ${expected_status_code} ${response.status_code} Check Response Headers Containing NGSILD-Results-Count ${expected_count} ${response.headers} Check Response Headers Containing NGSILD-Results-Count Equals To ${expected_count} ${response.headers} Setup Entities Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${first_entity_id} ${create_response1}= Create Entity Selecting Content Type Loading @@ -56,6 +56,6 @@ Setup Entities ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${create_response2.status_code} Delete Entities Delete Initial Entities Delete Entity by Id ${first_entity_id} Delete Entity by Id ${second_entity_id} doc/analysis/checks.py +17 −1 Original line number Diff line number Diff line Loading @@ -105,7 +105,9 @@ class Checks: 'Check Response Reason set to': Checks.check_response_reason_set_to, 'Check Response Does Not Contain Body': Checks.check_response_does_not_contain_body Checks.check_response_does_not_contain_body, 'Check Response Headers Containing NGSILD-Results-Count Equals To' : Checks.check_response_header_contains_ngsild_results_count_equals_to, } self.args = { Loading Loading @@ -303,6 +305,11 @@ class Checks: 'params': ['response'], 'position': [0] } , 'Check Response Headers Containing NGSILD-Results-Count Equals To': { 'params': ['expected_result_count' , 'response_headers'], 'position': [0, 1] } } @staticmethod Loading Loading @@ -871,6 +878,14 @@ class Checks: else: raise Exception(f"ERROR, Expected 'expected_value' and 'obtained_value' parameters but received: '{kwargs}'") @staticmethod def check_response_header_contains_ngsild_results_count_equals_to(kwargs: list) -> str: if "ngsild_results_count" in kwargs: ngsild_results_count = kwargs['ngsild_results_count'] return f'Response Header: NGSILD-Results-Count equals to {ngsild_results_count}' else: raise Exception(f'ERROR, Expected ngsild_results_count but received: {kwargs}') def get_checks(self, **kwargs) -> str: checking = None Loading Loading @@ -977,6 +992,7 @@ if __name__ == "__main__": 'Check Created Resources Set To'] , status_code=201)) print() print(data.get_checks(checks='Check Response Headers Containing NGSILD-Results-Count Equals To')) # Check exceptions try: Loading doc/analysis/initial_setup.py +0 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,6 @@ class InitialSetup: 'Setup Initial Context Source Registration Subscription': InitialSetup.init_csr_sub(), 'Setup Initial Context Source Registration Subscriptions': InitialSetup.init_csr_subs(), 'Create Initial Context Source Registration and Mock Server': InitialSetup.init_csr_and_server(), 'Setup Entities' : InitialSetup.init_entities(), } self.total_files = -1 Loading doc/analysis/requests.py +5 −3 Original line number Diff line number Diff line Loading @@ -1131,7 +1131,7 @@ class Requests: expected_parameters = ['entity_ids', 'entity_types', 'accept', 'attrs', 'context', 'geoproperty', 'options', 'limit', 'entity_id_pattern', 'georel', 'coordinates', 'geometry'] 'georel', 'coordinates', 'geometry', 'count' , 'q'] result = [x for x in kwargs if x not in expected_parameters] response = "Get Entities Request:" Loading Loading @@ -1160,8 +1160,10 @@ class Requests: response = f"{response} and\n Query Parameter: georel set to '{value}'" case 'coordinates': response = f"{response} and\n Query Parameter: coordinates set to '{value}'" case 'geometry': response = f"{response} and\n Query Parameter: geometry set to '{value}'" case 'count': response = f"{response} and\n Query Parameter: count set to '{value}'" case 'q': response = f"{response} and\n Query Parameter: q set to '{value}'" case _: raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " f"'{expected_parameters}', but received: {kwargs}") Loading resources/AssertionUtils.resource +1 −1 Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ Check Response Headers Containing URI set to ... ignore_order=True END Check Response Headers Containing NGSILD-Results-Count Check Response Headers Containing NGSILD-Results-Count Equals To [Arguments] ${expected_result_count} ${response_headers} Should Be Equal ${response_headers['NGSILD-Results-Count']} ${expected_result_count} Loading Loading
TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_07.robot +5 −5 Original line number Diff line number Diff line Loading @@ -6,8 +6,8 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Suite Setup Setup Entities Suite Teardown Delete Entities Suite Setup Setup Initial Entities Suite Teardown Delete Initial Entities Test Template Check that the total number of matching results is returned if the count parameter is set to true Loading Loading @@ -38,9 +38,9 @@ Check that the total number of matching results is returned if the count paramet ... context=${ngsild_test_suite_context} Check Response Status Code ${expected_status_code} ${response.status_code} Check Response Headers Containing NGSILD-Results-Count ${expected_count} ${response.headers} Check Response Headers Containing NGSILD-Results-Count Equals To ${expected_count} ${response.headers} Setup Entities Setup Initial Entities ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} Set Suite Variable ${first_entity_id} ${create_response1}= Create Entity Selecting Content Type Loading @@ -56,6 +56,6 @@ Setup Entities ... ${CONTENT_TYPE_LD_JSON} Check Response Status Code 201 ${create_response2.status_code} Delete Entities Delete Initial Entities Delete Entity by Id ${first_entity_id} Delete Entity by Id ${second_entity_id}
doc/analysis/checks.py +17 −1 Original line number Diff line number Diff line Loading @@ -105,7 +105,9 @@ class Checks: 'Check Response Reason set to': Checks.check_response_reason_set_to, 'Check Response Does Not Contain Body': Checks.check_response_does_not_contain_body Checks.check_response_does_not_contain_body, 'Check Response Headers Containing NGSILD-Results-Count Equals To' : Checks.check_response_header_contains_ngsild_results_count_equals_to, } self.args = { Loading Loading @@ -303,6 +305,11 @@ class Checks: 'params': ['response'], 'position': [0] } , 'Check Response Headers Containing NGSILD-Results-Count Equals To': { 'params': ['expected_result_count' , 'response_headers'], 'position': [0, 1] } } @staticmethod Loading Loading @@ -871,6 +878,14 @@ class Checks: else: raise Exception(f"ERROR, Expected 'expected_value' and 'obtained_value' parameters but received: '{kwargs}'") @staticmethod def check_response_header_contains_ngsild_results_count_equals_to(kwargs: list) -> str: if "ngsild_results_count" in kwargs: ngsild_results_count = kwargs['ngsild_results_count'] return f'Response Header: NGSILD-Results-Count equals to {ngsild_results_count}' else: raise Exception(f'ERROR, Expected ngsild_results_count but received: {kwargs}') def get_checks(self, **kwargs) -> str: checking = None Loading Loading @@ -977,6 +992,7 @@ if __name__ == "__main__": 'Check Created Resources Set To'] , status_code=201)) print() print(data.get_checks(checks='Check Response Headers Containing NGSILD-Results-Count Equals To')) # Check exceptions try: Loading
doc/analysis/initial_setup.py +0 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,6 @@ class InitialSetup: 'Setup Initial Context Source Registration Subscription': InitialSetup.init_csr_sub(), 'Setup Initial Context Source Registration Subscriptions': InitialSetup.init_csr_subs(), 'Create Initial Context Source Registration and Mock Server': InitialSetup.init_csr_and_server(), 'Setup Entities' : InitialSetup.init_entities(), } self.total_files = -1 Loading
doc/analysis/requests.py +5 −3 Original line number Diff line number Diff line Loading @@ -1131,7 +1131,7 @@ class Requests: expected_parameters = ['entity_ids', 'entity_types', 'accept', 'attrs', 'context', 'geoproperty', 'options', 'limit', 'entity_id_pattern', 'georel', 'coordinates', 'geometry'] 'georel', 'coordinates', 'geometry', 'count' , 'q'] result = [x for x in kwargs if x not in expected_parameters] response = "Get Entities Request:" Loading Loading @@ -1160,8 +1160,10 @@ class Requests: response = f"{response} and\n Query Parameter: georel set to '{value}'" case 'coordinates': response = f"{response} and\n Query Parameter: coordinates set to '{value}'" case 'geometry': response = f"{response} and\n Query Parameter: geometry set to '{value}'" case 'count': response = f"{response} and\n Query Parameter: count set to '{value}'" case 'q': response = f"{response} and\n Query Parameter: q set to '{value}'" case _: raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " f"'{expected_parameters}', but received: {kwargs}") Loading
resources/AssertionUtils.resource +1 −1 Original line number Diff line number Diff line Loading @@ -60,7 +60,7 @@ Check Response Headers Containing URI set to ... ignore_order=True END Check Response Headers Containing NGSILD-Results-Count Check Response Headers Containing NGSILD-Results-Count Equals To [Arguments] ${expected_result_count} ${response_headers} Should Be Equal ${response_headers['NGSILD-Results-Count']} ${expected_result_count} Loading