Commit 635d2c57 authored by Benoit Orihuela's avatar Benoit Orihuela Committed by poujol
Browse files

chore: review all set up and teardown with a common behaviour

parent 332c6373
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource
Resource            ${EXECDIR}/resources/AssertionUtils.resource
Resource            ${EXECDIR}/resources/JsonUtils.resource

Suite Setup         Setup Initial Entities
Suite Teardown      Delete Initial Entities
Test Setup          Setup Initial Entities
Test Teardown       Delete Initial Entities
Test Template       Retrieve Available Attributes


@@ -38,7 +38,7 @@ Setup Initial Entities
    ...    ${entity_id}
    ...    ${CONTENT_TYPE_JSON}
    ...    ${ngsild_test_suite_context}
    Set Suite Variable    ${entity_id}
    Set Test Variable    ${entity_id}

Delete Initial Entities
    Delete Entity by Id Returning Response    ${entity_id}
+4 −4
Original line number Diff line number Diff line
@@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource
Resource            ${EXECDIR}/resources/AssertionUtils.resource
Resource            ${EXECDIR}/resources/JsonUtils.resource

Suite Setup         Setup Initial Entities
Suite Teardown      Delete Initial Entities
Test Setup          Setup Initial Entities
Test Teardown       Delete Initial Entities
Test Template       Retrieve Available Entity Types


@@ -46,8 +46,8 @@ Setup Initial Entities
    ...    ${second_entity_id}
    ...    ${CONTENT_TYPE_JSON}
    ...    ${ngsild_test_suite_context}
    Set Suite Variable    ${first_entity_id}
    Set Suite Variable    ${second_entity_id}
    Set Test Variable    ${first_entity_id}
    Set Test Variable    ${second_entity_id}

Delete Initial Entities
    Delete Entity by Id Returning Response    ${first_entity_id}
+3 −3
Original line number Diff line number Diff line
@@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource
Resource            ${EXECDIR}/resources/AssertionUtils.resource
Resource            ${EXECDIR}/resources/JsonUtils.resource

Suite Setup         Setup Initial Entities
Suite Teardown      Delete Initial Entities
Test Setup          Setup Initial Entities
Test Teardown       Delete Initial Entities
Test Template       Retrieve Details Of Available Attributes


@@ -38,7 +38,7 @@ Setup Initial Entities
    ...    ${entity_id}
    ...    ${CONTENT_TYPE_JSON}
    ...    ${ngsild_test_suite_context}
    Set Suite Variable    ${entity_id}
    Set Test Variable    ${entity_id}

Delete Initial Entities
    Delete Entity by Id Returning Response    ${entity_id}
+4 −4
Original line number Diff line number Diff line
@@ -5,8 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource
Resource            ${EXECDIR}/resources/AssertionUtils.resource
Resource            ${EXECDIR}/resources/JsonUtils.resource

Suite Setup         Setup Initial Entities
Suite Teardown      Delete Initial Entities
Test Setup          Setup Initial Entities
Test Teardown       Delete Initial Entities
Test Template       Retrieve Details Of Available Entity Types


@@ -46,8 +46,8 @@ Setup Initial Entities
    ...    ${second_entity_id}
    ...    ${CONTENT_TYPE_JSON}
    ...    ${ngsild_test_suite_context}
    Set Suite Variable    ${first_entity_id}
    Set Suite Variable    ${second_entity_id}
    Set Test Variable    ${first_entity_id}
    Set Test Variable    ${second_entity_id}

Delete Initial Entities
    Delete Entity by Id Returning Response    ${first_entity_id}
+6 −2
Original line number Diff line number Diff line
@@ -5,6 +5,8 @@ Resource ${EXECDIR}/resources/ApiUtils.resource
Resource            ${EXECDIR}/resources/AssertionUtils.resource
Resource            ${EXECDIR}/resources/JsonUtils.resource

Suite Teardown      Delete Entities


*** Variables ***
${building_id_prefix}=      urn:ngsi-ld:Building:
@@ -18,18 +20,21 @@ Query several entities based on ids
    [Documentation]    Check that you can query several entities based on ids
    [Tags]    e-query    5_7_2
    ${first_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    Set Suite Variable    ${first_entity_id}
    ${response}=    Create Entity Selecting Content Type
    ...    ${filename}
    ...    ${first_entity_id}
    ...    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    201    ${response.status_code}
    ${second_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    Set Suite Variable    ${second_entity_id}
    ${response}=    Create Entity Selecting Content Type
    ...    ${filename}
    ...    ${second_entity_id}
    ...    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    201    ${response.status_code}
    ${third_entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    Set Suite Variable    ${third_entity_id}
    ${response}=    Create Entity Selecting Content Type
    ...    ${filename}
    ...    ${third_entity_id}
@@ -46,12 +51,11 @@ Query several entities based on ids
    ...    ${expectation_filename}
    ...    ${entities_ids_to_be_compared}
    ...    ${response.json()}
    [Teardown]    Delete Entities    ${first_entity_id}    ${second_entity_id}    ${third_entity_id}



*** Keywords ***
Delete Entities
    [Arguments]    ${first_entity_id}    ${second_entity_id}    ${third_entity_id}
    Delete Entity by Id Returning Response    ${first_entity_id}
    Delete Entity by Id Returning Response    ${second_entity_id}
    Delete Entity by Id Returning Response    ${third_entity_id}
Loading