Commit 9ebf6743 authored by lopezaguilar's avatar lopezaguilar
Browse files

Adding documentation and check backward the documentation with the new processes

parent ef6dd4d1
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 −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 ***
+3 −1
Original line number Diff line number Diff line
@@ -35,7 +35,9 @@ Append Attributes Without Params
    ...    id=${entity_id}
    ...    context=${ngsild_test_suite_context}
    ...    accept=${CONTENT_TYPE_LD_JSON}
    Check Updated Resource Set To    ${entity_expectation_payload}    ${response1.json()}
    Check Updated Resource Set To
    ...    updated_resource=${entity_expectation_payload}
    ...    response_body=${response1.json()}

Create Initial Entity
    ${entity_id}=    Generate Random Entity Id    ${vehicle_id_prefix}
+9 −12
Original line number Diff line number Diff line
@@ -16,38 +16,35 @@ ${vehicle_id_prefix}= urn:ngsi-ld:Vehicle:
${filename}=                vehicle-speed-two-datasetid-sample.jsonld


*** Test Cases ***    STATUS_CODE    FRAGMENT_FILENAME    EXPECTATION_RESPONSE_BODY    EXPECTATION_FILENAME
*** Test Cases ***    STATUS_CODE    FRAGMENT_FILENAME    EXPECTATION_FILENAME
010_04_01 Append entity attributes and ignore existing multi-attribute instance
    204    vehicle-attribute-to-add-fragment.jsonld    ${EMPTY}    vehicle-speed-appended-expectation.jsonld
    204    vehicle-attribute-to-add-fragment.jsonld    vehicle-speed-appended-expectation.jsonld
010_04_02 Append entity attributes with a new multi-attribute instance
    204    vehicle-speed-different-datasetid-fragment.jsonld    ${EMPTY}    vehicle-speed-different-datasetid-expectation.jsonld
    204    vehicle-speed-different-datasetid-fragment.jsonld    vehicle-speed-different-datasetid-expectation.jsonld


*** Keywords ***
Append Attributes With Params
    [Documentation]    Check that you can append entity attributes
    [Tags]    ea-append    5_6_3
    [Arguments]    ${status_code}    ${fragment_filename}    ${expectation_response_body}    ${expectation_filename}
    [Arguments]    ${status_code}    ${fragment_filename}    ${expectation_filename}
    ${response}=    Append Entity Attributes With Parameters
    ...    ${entity_id}
    ...    ${fragment_filename}
    ...    ${CONTENT_TYPE_LD_JSON}
    ...    noOverwrite
    Check Response Status Code    ${status_code}    ${response.status_code}
    # ignore the reason for the not updated attribute as this detail is up to each context broker implementation
    IF    "${expectation_response_body}"!="${EMPTY}"
        Check Response Body Content
        ...    expectation_filename=${expectation_response_body}
        ...    response_body=${response.json()}
        ...    additional_ignored_path=root\\['notUpdated'\\]\\[0\\]\\['reason'\\]
    END

    ${entity_expectation_payload}=    Load Test Sample    entities/expectations/${expectation_filename}    ${entity_id}
    ${response1}=    Retrieve Entity by Id
    ...    id=${entity_id}
    ...    context=${ngsild_test_suite_context}
    ...    accept=${CONTENT_TYPE_LD_JSON}
    ${ignored_attributes}=    Create List    @context
    Check Updated Resource Set To    ${entity_expectation_payload}    ${response1.json()}    ${ignored_attributes}
    Check Updated Resource Set To
    ...    updated_resource=${entity_expectation_payload}
    ...    response_body=${response1.json()}
    ...    ignored_keys=${ignored_attributes}

Create Initial Entity
    ${entity_id}=    Generate Random Entity Id    ${vehicle_id_prefix}
Loading