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

chore: remove potentially dangerous uses of Set Global Variable

parent c95dce04
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -64,7 +64,7 @@ Setup Initial Entities
    ...    ${new_entity}
    ...    ${new_entity}
    ...    ${first_existing_entity}
    ...    ${first_existing_entity}
    ...    ${second_existing_entity}
    ...    ${second_existing_entity}
    Set Global Variable    ${entities_to_be_upserted}
    Set Test Variable    ${entities_to_be_upserted}


Delete Initial Entities
Delete Initial Entities
    @{entities_ids_to_be_deleted}=    Create List
    @{entities_ids_to_be_deleted}=    Create List
+2 −2
Original line number Original line Diff line number Diff line
@@ -6,7 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.
Resource            ${EXECDIR}/resources/AssertionUtils.resource
Resource            ${EXECDIR}/resources/AssertionUtils.resource
Resource            ${EXECDIR}/resources/JsonUtils.resource
Resource            ${EXECDIR}/resources/JsonUtils.resource


Suite Teardown      Delete Entities
Test Teardown       Delete Entities




*** Variables ***
*** Variables ***
@@ -27,7 +27,7 @@ ${building_id_prefix}= urn:ngsi-ld:Building:
    @{entities_to_be_upserted}=    Create List    ${first_entity}    ${second_entity}    ${invalid_entity}
    @{entities_to_be_upserted}=    Create List    ${first_entity}    ${second_entity}    ${invalid_entity}
    ${response}=    Batch Upsert Entities    @{entities_to_be_upserted}
    ${response}=    Batch Upsert Entities    @{entities_to_be_upserted}
    @{expected_successful_entities_ids}=    Create List    ${first_entity_id}    ${second_entity_id}
    @{expected_successful_entities_ids}=    Create List    ${first_entity_id}    ${second_entity_id}
    Set Global Variable    ${expected_successful_entities_ids}
    Set Test Variable    ${expected_successful_entities_ids}
    @{expected_failed_entities_ids}=    Create List    ${third_entity_id}
    @{expected_failed_entities_ids}=    Create List    ${third_entity_id}
    &{expected_batch_operation_result}=    Create Batch Operation Result
    &{expected_batch_operation_result}=    Create Batch Operation Result
    ...    success=${expected_successful_entities_ids}
    ...    success=${expected_successful_entities_ids}
+1 −1
Original line number Original line Diff line number Diff line
@@ -36,7 +36,7 @@ Update entity attributes with invalid entity fragments
Initialize Environment
Initialize Environment
    [Arguments]    ${filename}
    [Arguments]    ${filename}
    ${entity_id}=    Generate Random Entity Id    ${vehicle_id_prefix}
    ${entity_id}=    Generate Random Entity Id    ${vehicle_id_prefix}
    Set Global Variable    ${entity_id}
    Set Test Variable    ${entity_id}
    ${response}=    Create Entity Selecting Content Type
    ${response}=    Create Entity Selecting Content Type
    ...    ${filename}
    ...    ${filename}
    ...    ${entity_id}
    ...    ${entity_id}
+1 −1
Original line number Original line Diff line number Diff line
@@ -39,7 +39,7 @@ Add an Attribute To a Temporal Entity From File


Initialize Test Case
Initialize Test Case
    ${temporal_entity_representation_id}=    Generate Random Entity Id    ${vehicle_id_prefix}
    ${temporal_entity_representation_id}=    Generate Random Entity Id    ${vehicle_id_prefix}
    Set Global Variable    ${temporal_entity_representation_id}
    Set Test Variable    ${temporal_entity_representation_id}
    ${response}=    Create Or Update Temporal Representation Of Entity Selecting Content Type
    ${response}=    Create Or Update Temporal Representation Of Entity Selecting Content Type
    ...    temporal_entity_representation_id=${temporal_entity_representation_id}
    ...    temporal_entity_representation_id=${temporal_entity_representation_id}
    ...    filename=${filename}
    ...    filename=${filename}
+2 −2
Original line number Original line Diff line number Diff line
@@ -44,8 +44,8 @@ Delete An Attribute
Create Id
Create Id
    ${valid_temporal_entity_id}=    Generate Random Entity Id    ${vehicle_id_prefix}
    ${valid_temporal_entity_id}=    Generate Random Entity Id    ${vehicle_id_prefix}
    ${unknown_temporal_entity_id}=    Generate Random Entity Id    ${vehicle_id_prefix}
    ${unknown_temporal_entity_id}=    Generate Random Entity Id    ${vehicle_id_prefix}
    Set Global Variable    ${valid_temporal_entity_id}
    Set Test Variable    ${valid_temporal_entity_id}
    Set Global Variable    ${unknown_temporal_entity_id}
    Set Test Variable    ${unknown_temporal_entity_id}
    ${response}=    Create Or Update Temporal Representation Of Entity Selecting Content Type
    ${response}=    Create Or Update Temporal Representation Of Entity Selecting Content Type
    ...    temporal_entity_representation_id=${valid_temporal_entity_id}
    ...    temporal_entity_representation_id=${valid_temporal_entity_id}
    ...    filename=${filename}
    ...    filename=${filename}
Loading