Commit 308e7776 authored by Benoit Orihuela's avatar Benoit Orihuela
Browse files

fix: all checks on response status code when using rf-requests library

parent 47065dd3
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -40,9 +40,9 @@ Update entity attributes with invalid entity fragments
    ${entity_id}=     Generate Random Entity Id    ${vehicle_id_prefix}
    ${request}    ${response}=    Create Entity Selecting Content Type  ${filename}     ${entity_id}    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code  201    ${response['status']}
    Output  ${fragment_filename}
    ${response}=  Update Entity Attributes Using Session    ${entity_id}    ${fragment_filename}    ${CONTENT_TYPE_LD_JSON}    ${EMPTY}
    Check Response Status Code  400    ${response}

    Update Entity Attributes Using Session    ${entity_id}    ${fragment_filename}    ${CONTENT_TYPE_LD_JSON}    ${EMPTY}
    Check RL Response Status Code Set To  400
    Check Response Body Type When Using Session Request      ${response.json()}     ${ERROR_TYPE_BAD_REQUEST_DATA}
    Check Response Body Title When Using Session Request    ${response.json()}

+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ Create Temporal Entity From File
    [Tags]  mandatory

    ${response}=  Create Temporal Representation Of Entity Selecting Content Type Using Session  ${filename}     ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code  ${status_code}    ${response['status']}
    Check Response Status Code  <Response [400]>    ${response['status']}
    Check Response Body Type When Using Session Request      ${response.json()}     ${ERROR_TYPE_BAD_REQUEST_DATA}
    Check Response Body Title When Using Session Request    ${response.json()}

+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ Add an Attribute To a Temporal Entity
    Check Response Status Code  201    ${response['status']}

    ${response}=  Append Attribute To Temporal Entity Using Session  ${temporal_entity_representation_id}    ${update_filename}     ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code   ${status_code}    ${response['status']}
    Check Response Status Code   <Response [400]>    ${response['status']}

    [Teardown]    Delete Temporal Representation Of Entity    ${temporal_entity_representation_id}

+1 −1
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ Update a context source registration if the request body is invalid
    Check Response Status Code  201    ${response['status']}

    ${response}=    Update Context Source Registration Using Session  ${registration_id}    ${registration_payload_file_path}    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code  400    ${response}
    Check Response Status Code  <Response [400]>    ${response}
    Check Response Body Type When Using Session Request      ${response.json()}     ${ERROR_TYPE_BAD_REQUEST_DATA}
    Check Response Body Title When Using Session Request    ${response.json()}

+1 −1
Original line number Diff line number Diff line
@@ -165,7 +165,7 @@ Update Entity Attributes Using Session
    &{headers}=  Create Dictionary  Content-Type=${content_type}
    ${response}=    PATCH On Session      OneRequest   ${ENTITIES_ENDPOINT_PATH}${id}/attrs/    data=${file_content}    headers=${headers}   expected_status=any
    Output  ${response.json()}
    [return]    ${response}
    Set Test Variable  ${response}

Update Entity Attributes
    [Arguments]  ${id}    ${fragment_filename}    ${content_type}