Commit ae4fa60d authored by Benoit Orihuela's avatar Benoit Orihuela
Browse files

Merge remote-tracking branch 'origin/feature/tcs-count-parameter' into parsespec

parents 4a02ef43 60c39b09
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource

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
Test Template       Query Entities With Count


*** Variables ***
@@ -27,7 +27,7 @@ ${airQualityLevel}= airQualityLevel==6


*** Keywords ***
Check that the total number of matching results is returned if the count parameter is set to true
Query Entities With Count
    [Documentation]    If the count parameter is set to true the special HTTP header NGSILD-Results-Count is set in the response and it must contain the total number of matching results.
    [Tags]    e-query    5_7_2    6_3_13
    [Arguments]    ${q}    ${expected_status_code}    ${expected_count}
+4 −4
Original line number Diff line number Diff line
@@ -893,11 +893,11 @@ class Checks:

    @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}'
        if 'expected_result_count' in kwargs:
            expected_result_count = kwargs['expected_result_count']
            return f'Response Header: NGSILD-Results-Count equals to {expected_result_count}'
        else:
            raise Exception(f'ERROR, Expected ngsild_results_count but received: {kwargs}')
            raise Exception(f"ERROR, Expected 'expected_result_count' but received: '{kwargs}'")

    def get_checks(self, **kwargs) -> str:
        checking = None
+2 −0
Original line number Diff line number Diff line
@@ -1162,6 +1162,8 @@ 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':