Commit 77a9cc8e authored by lopezaguilar's avatar lopezaguilar Committed by Benoit Orihuela
Browse files

Provide Test Cases for @Context endpoints operations

parent 1b8cdbda
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
<component name="ProjectRunConfigurationManager">
  <configuration default="false" name="jsonldContext Consumption Unit Tests" type="tests" factoryName="Autodetect">
    <module name="ngsi-ld-test-suite" />
    <option name="ENV_FILES" value="" />
    <option name="INTERPRETER_OPTIONS" value="" />
    <option name="PARENT_ENVS" value="true" />
    <option name="SDK_HOME" value="" />
    <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/doc" />
    <option name="IS_MODULE_SDK" value="true" />
    <option name="ADD_CONTENT_ROOTS" value="true" />
    <option name="ADD_SOURCE_ROOTS" value="true" />
    <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
    <option name="_new_additionalArguments" value="&quot;&quot;" />
    <option name="_new_target" value="&quot;$PROJECT_DIR$/doc/tests/test_jsonldContext_Consumption.py&quot;" />
    <option name="_new_targetType" value="&quot;PATH&quot;" />
    <method v="2" />
  </configuration>
</component>
 No newline at end of file
+18 −0
Original line number Diff line number Diff line
<component name="ProjectRunConfigurationManager">
  <configuration default="false" name="jsonldContext Provision Unit Tests" type="tests" factoryName="Autodetect">
    <module name="ngsi-ld-test-suite" />
    <option name="ENV_FILES" value="" />
    <option name="INTERPRETER_OPTIONS" value="" />
    <option name="PARENT_ENVS" value="true" />
    <option name="SDK_HOME" value="" />
    <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/doc" />
    <option name="IS_MODULE_SDK" value="true" />
    <option name="ADD_CONTENT_ROOTS" value="true" />
    <option name="ADD_SOURCE_ROOTS" value="true" />
    <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
    <option name="_new_additionalArguments" value="&quot;&quot;" />
    <option name="_new_target" value="&quot;$PROJECT_DIR$/doc/tests/test_jsonldContext_Provision.py&quot;" />
    <option name="_new_targetType" value="&quot;PATH&quot;" />
    <method v="2" />
  </configuration>
</component>
 No newline at end of file
+3 −0
Original line number Diff line number Diff line
@@ -72,6 +72,9 @@ server to listen to notifications (the address must be accessible by the context
Default value: `0.0.0.0` and `8085`.
- `context_source_host` and `context_source_port` : The address and port used for the context source. 
Default value: `0.0.0.0` and `8086`.
- `context_server_host` and `context_server_port` : The address and port used for the context server provider. 
Default value: `0.0.0.0` and `8087`.
- `core_context`: The default cached core context used by the Brokers.

When you execute locally the tests, you can leave the default values as they are. NGSI-LD Test Suite provides
a mockup services to provide the notification functionality and therefore the notification_server_host can be
+3 −3
Original line number Diff line number Diff line
@@ -49,9 +49,9 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building
    ...    entity_types=${entity_types_to_be_retrieved}
    Check Response Status Code    200    ${response.status_code}
    Check Response Body Containing List Containing Entity Elements
    ...    ${expectation_filename}
    ...    ${entities_ids_to_be_compared}
    ...    ${response.json()}
    ...    expectation_filename=${expectation_filename}
    ...    entities_ids=${entities_ids_to_be_compared}
    ...    response_body=${response.json()}


*** Keywords ***
+2 −1
Original line number Diff line number Diff line
@@ -21,15 +21,16 @@ ${airQualityLevel}= airQualityLevel==6

*** Test Cases ***    Q_PARAMETER    EXPECTED_STATUS    EXPECTED_COUNT
019_07_01 Check that the total number of matching results is returned if the count parameter is set to true and only the entity type is provided
    [Tags]    e-query    5_7_2    6_3_13
    ${EMPTY}    200    2
019_07_02 Check that the total number of matching results is returned if the count parameter is set to true and a q parameter is provided
    [Tags]    e-query    5_7_2    6_3_13
    ${airQualityLevel}    200    1


*** Keywords ***
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}
    ${response}=    Query Entities
    ...    entity_types=${entity_type}
Loading