Commit 240d91f1 authored by Benedetta Arena's avatar Benedetta Arena
Browse files

fix: first and second point bullet point

parent 48d5ff4e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ ${building_filename}= building-minimal.jsonld
${vehicle_filename}=        vehicle-simple-attributes.jsonld
${expectation_filename}=    vehicle-simple-attributes-core-context.json
${attribute_brandname}=     https://ngsi-ld-test-suite/context#brandName
${attribute_isparked}=      https://uri.etsi.org/ngsi-ld/default-context/isParked
${attribute_isparked}=      https://ngsi-ld-test-suite/context#isParked


*** Test Cases ***
+2 −2
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ ${entity_payload_filename} vehicle-simple-attributes.json
${entity_payload_filename2}             vehicle-simple-attributes-second.jsonld
${registration_payload_file_path}       csourceRegistrations/context-source-registration-vehicle-complete.jsonld
${fragment_filename}                    vehicle-brandname-fragment.json
${expected_attribute}                   brandName
${expected_attribute}                   https://ngsi-ld-test-suite/context#brandName


*** Test Cases ***
@@ -35,7 +35,7 @@ D010_01_aux Retrieve Entity That Exists On Both The Context Source And The Conte
    # mock ends up sending headers only). Serialise to a JSON string first.
    ${entity_body_json}=    Evaluate    json.dumps($entity_body)    json
    Set Stub Reply    GET    /ngsi-ld/v1/entities/${entity_id}    200    ${entity_body_json}
    ${response}=    Retrieve Entity    ${entity_id}    context=${ngsild_test_suite_context}
    ${response}=    Retrieve Entity    ${entity_id}

    Check Response Status Code    200    ${response.status_code}
    Check Response Body Containing an Attribute set to
+7 −5
Original line number Diff line number Diff line
@@ -16,8 +16,10 @@ Test Teardown Delete Registration And Stop Context Source Mock Server

*** Variables ***
${entity_payload_filename}              vehicle-simple-attributes.jsonld
${fragment_filename}                    vehicle-speed-isParked-fragment.json
${fragment_filename}                    vehicle-speed-isParked-fragment.jsonld
${registration_payload_file_path}       csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld
${expected_attribute_isParked}          https://ngsi-ld-test-suite/context#isParked
${expected_attribute_speed}             https://ngsi-ld-test-suite/context#speed

*** Test Cases ***
D003_01_inc Append Entity Attribute
@@ -25,22 +27,22 @@ D003_01_inc Append Entity Attribute
    [Tags]    since_v1.6.1    dist-ops    4_3_3    cf_04    additive-inclusive    4_3_6_2    5_6_3

    ${response}=    Retrieve Entity    ${entity_id}
    ${old_body}=    Get From Dictionary    ${response.json()}    isParked
    ${old_body}=    Get From Dictionary    ${response.json()}    ${expected_attribute_isParked}

    Set Stub Reply    POST    /ngsi-ld/v1/entities/${entity_id}/attrs/    204
    ${response}=    Append Entity Attributes
    ...    ${entity_id}
    ...    ${fragment_filename}
    ...    ${CONTENT_TYPE_JSON}
    ...    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    204    ${response.status_code}

    ${stub_count}=    Get Stub Count    POST    /ngsi-ld/v1/entities/${entity_id}/attrs/
    Should Be Equal As Integers    ${stub_count}    1

    ${response}=    Retrieve Entity    ${entity_id}
    ${new_body}=    Get From Dictionary    ${response.json()}    isParked
    ${new_body}=    Get From Dictionary    ${response.json()}    ${expected_attribute_isParked}

    Should Have Value In Json    ${response.json()}    $.speed
    Should Contain    ${response.json()}    ${expected_attribute_speed}
    Should Not Be Equal    ${old_body}    ${new_body}

*** Keywords ***
+7 −5
Original line number Diff line number Diff line
@@ -15,8 +15,10 @@ Test Teardown Delete Registration And Stop Context Source Mock Server

*** Variables ***
${entity_payload_filename}              vehicle-simple-attributes.jsonld
${fragment_filename}                    vehicle-speed-isParked-fragment.json
${fragment_filename}                    vehicle-speed-isParked-fragment.jsonld
${registration_payload_file_path}       csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld
${expected_attribute_isParked}          https://ngsi-ld-test-suite/context#isParked
${expected_attribute_speed}             https://ngsi-ld-test-suite/context#speed

*** Test Cases ***
D003_02_inc Append Entity Attribute
@@ -24,13 +26,13 @@ D003_02_inc Append Entity Attribute
    [Tags]    since_v1.6.1    dist-ops    4_3_3    cf_04    additive-inclusive    4_3_6_2    5_6_3

    ${response}=    Retrieve Entity    ${entity_id}
    ${old_body}=    Get From Dictionary    ${response.json()}    isParked
    ${old_body}=    Get From Dictionary    ${response.json()}    ${expected_attribute_isParked}

    Set Stub Reply    POST    /ngsi-ld/v1/entities/${entity_id}/attrs/    207
    ${response}=    Append Entity Attributes With Parameters
    ...    ${entity_id}
    ...    ${fragment_filename}
    ...    ${CONTENT_TYPE_JSON}
    ...    ${CONTENT_TYPE_LD_JSON}
    ...    noOverwrite
    Wait For Request
    Check Response Status Code    207    ${response.status_code}
@@ -39,8 +41,8 @@ D003_02_inc Append Entity Attribute
    Should Contain    ${stub}    noOverwrite

    ${response}=    Retrieve Entity    ${entity_id}
    ${new_body}=    Get From Dictionary    ${response.json()}    isParked
    Should Have Value In Json    ${response.json()}    $.speed
    ${new_body}=    Get From Dictionary    ${response.json()}    ${expected_attribute_isParked}
    Should Contain    ${response.json()}    ${expected_attribute_speed}
    Should Be Equal    ${old_body}    ${new_body}

*** Keywords ***
+4 −4
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@
      "entities": [
        {
          "id": "urn:ngsi-ld:Vehicle:A456",
          "type": "https://ngsi-ld-test-suite/context#Vehicle"
          "type": ["https://ngsi-ld-test-suite/context#Vehicle"]
        }
      ],
      "propertyNames": [
@@ -15,17 +15,17 @@
        "https://ngsi-ld-test-suite/context#speed"
      ],
      "relationshipNames": [
        "isParked"
        "https://ngsi-ld-test-suite/context#isParked"
      ]
    },
    {
      "entities": [
        {
          "type": "https://ngsi-ld-test-suite/context#OffStreetParking",
          "type": ["https://ngsi-ld-test-suite/context#OffStreetParking"],
          "idPattern": ".*downtown$"
        },
        {
          "type": "https://ngsi-ld-test-suite/context#OffStreetParking",
          "type": ["https://ngsi-ld-test-suite/context#OffStreetParking"],
          "idPattern": ".*47$"
        }
      ],
Loading