Commit 7b8691da authored by poujol's avatar poujol
Browse files

Merge branch 'feature/clean-up-used-libraries' into 'develop'

chore: clean up used libraries

See merge request !79
parents 01715180 102e979f
Loading
Loading
Loading
Loading
+1 −10
Original line number Diff line number Diff line
@@ -107,14 +107,6 @@ Launch the tests with the following command:

For more running instructions please consult [scripts/run_tests.sh](./scripts/run_tests.sh).

## Generate metrics from the tests results

Optionally, you can generate metrics from the results of tests:

```$ robotmetrics --inputpath <directory_containing_results>  -k True -s True```

A sample report can be seen at https://robotmetrics.netlify.app/#

## Generate a documentation for the support keywords

```$ python3 -m robot.libdoc resources/ApiUtils.resource api_docs/ApiUtils.html```
@@ -126,11 +118,10 @@ A sample report can be seen at https://robotmetrics.netlify.app/#
# Frameworks and libraries used in the project

* [Robot Framework](https://github.com/robotframework/robotframework)
* [RESTinstance](https://github.com/asyrjasalo/RESTinstance)
* [JSON Schema Library](https://github.com/jstaffans/robotframework-jsonschemalibrary)
* [JSON Library](https://github.com/robotframework-thailand/robotframework-jsonlibrary)
* [Requests Library](https://github.com/MarketSquare/robotframework-requests)
* [Deep Diff](https://github.com/seperman/deepdiff)
* [HttpCtrl Library](https://github.com/annoviko/robotframework-httpctrl)
* [Robotidy Library ](https://github.com/MarketSquare/robotframework-tidy)

# Useful links   
+16 −17
Original line number Diff line number Diff line
@@ -23,15 +23,15 @@ ${registration_filename}= csourceRegistrations/context-source-registration
    [Documentation]    Verify throwing 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create entity)
    [Tags]    e-create    5_2_2
    ${entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    ${request}    ${response}=    Create Entity Selecting Content Type
    ${response}=    Create Entity Selecting Content Type
    ...    ${building_filename}
    ...    ${entity_id}
    ...    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    ${expected_status_code}    ${response['status']}
    Check Response Status Code    ${expected_status_code}    ${response.status_code}
    Check Response Body Containing ProblemDetails Element Containing Type Element set to
    ...    ${response}
    ...    ${response.json()}
    ...    ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE}
    Check Response Body Containing ProblemDetails Element Containing Title Element    ${response}
    Check Response Body Containing ProblemDetails Element Containing Title Element    ${response.json()}
    [Teardown]    Delete Entity by Id    ${entity_id}

043_02 Create subscription
@@ -39,11 +39,11 @@ ${registration_filename}= csourceRegistrations/context-source-registration
    [Tags]    sub-create    5_2_2
    ${subscription_id}=    Generate Random Entity Id    ${subscription_id_prefix}
    ${response}=    Create Subscription    ${subscription_id}    ${subscription_filename}    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    ${expected_status_code}    ${response['status']}
    Check Response Status Code    ${expected_status_code}    ${response.status_code}
    Check Response Body Containing ProblemDetails Element Containing Type Element set to
    ...    ${response}
    ...    ${response.json()}
    ...    ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE}
    Check Response Body Containing ProblemDetails Element Containing Title Element    ${response}
    Check Response Body Containing ProblemDetails Element Containing Title Element    ${response.json()}
    [Teardown]    Delete Subscription    ${subscription_id}

043_03 Create Temporal Representation of Entities
@@ -54,11 +54,11 @@ ${registration_filename}= csourceRegistrations/context-source-registration
    ...    ${temporal_entity_representation_id}
    ...    ${tea_filename}
    ...    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    ${expected_status_code}    ${response['status']}
    Check Response Status Code    ${expected_status_code}    ${response.status_code}
    Check Response Body Containing ProblemDetails Element Containing Type Element set to
    ...    ${response}
    ...    ${response.json()}
    ...    ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE}
    Check Response Body Containing ProblemDetails Element Containing Title Element    ${response}
    Check Response Body Containing ProblemDetails Element Containing Title Element    ${response.json()}
    [Teardown]    Delete Temporal Representation Of Entity    ${temporal_entity_representation_id}

043_04 Batch entity create
@@ -69,12 +69,12 @@ ${registration_filename}= csourceRegistrations/context-source-registration
    ${first_entity}=    Load Entity    ${building_filename}    ${first_entity_id}
    ${second_entity}=    Load Entity    ${building_filename}    ${second_entity_id}
    @{entities_to_be_created}=    Create List    ${first_entity}    ${second_entity}
    Batch Create Entities    @{entities_to_be_created}    content_type=${CONTENT_TYPE_LD_JSON}
    Check Response Status Code Set To    ${expected_status_code}
    ${response}=    Batch Create Entities    @{entities_to_be_created}    content_type=${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    ${expected_status_code}    ${response.status_code}
    Check Response Body Containing ProblemDetails Element Containing Type Element set to
    ...    ${response}
    ...    ${response.json()}
    ...    ${ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE}
    Check Response Body Containing ProblemDetails Element Containing Title Element    ${response}
    Check Response Body Containing ProblemDetails Element Containing Title Element    ${response.json()}
    [Teardown]    Batch Delete Entities    @{entities_to_be_created}

043_05 Create context source registration
@@ -83,7 +83,6 @@ ${registration_filename}= csourceRegistrations/context-source-registration
    ${registration_id}=    Generate Random Entity Id    ${registration_id_prefix}
    ${payload}=    Load JSON From File    ${EXECDIR}/data/${registration_filename}
    ${updated_payload}=    Update Value To JSON    ${payload}    $..id    ${registration_id}
    ${request}    ${response}=    Create Context Source Registration With Return    ${updated_payload}
    Check Response Status Code    ${expected_status_code}    ${response['status']}
    Check Response Headers Containing URI set to    ${request['path']}/    ${registration_id}    ${response}
    ${response}=    Create Context Source Registration With Return    ${updated_payload}
    Check Response Status Code    ${expected_status_code}    ${response.status_code}
    [Teardown]    Delete Context Source Registration    ${registration_id}
+5 −5
Original line number Diff line number Diff line
@@ -21,18 +21,18 @@ ${subscription_fragment}= subscriptions/fragments/subscription-update-samp
    [Documentation]    Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type
    [Tags]    ea-partial-update    6_3_4
    ${entity_id}=    Generate Random Entity Id    ${vehicle_id_prefix}
    ${request}    ${response}=    Create Entity Selecting Content Type
    ${response}=    Create Entity Selecting Content Type
    ...    ${vehicle_filename}
    ...    ${entity_id}
    ...    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    201    ${response['status']}
    Check Response Status Code    201    ${response.status_code}
    ${response}=    Partial Update Entity Attributes
    ...    ${entity_id}
    ...    ${attribute_id}
    ...    ${vehicle_fragment}
    ...    ${CONTENT_TYPE_MERGE_PATCH_JSON}
    ...    context=${ngsild_test_suite_context}
    Check Response Status Code    204    ${response['status']}
    Check Response Status Code    204    ${response.status_code}
    [Teardown]    Delete Entity by Id    ${entity_id}

044_01_02_endpoint /subscriptions/{subscriptionId}
@@ -40,11 +40,11 @@ ${subscription_fragment}= subscriptions/fragments/subscription-update-samp
    [Tags]    sub-update    6_3_4
    ${subscription_id}=    Generate Random Entity Id    ${subscription_id_prefix}
    ${response}=    Create Subscription    ${subscription_id}    ${subscription_filename}    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    201    ${response['status']}
    Check Response Status Code    201    ${response.status_code}
    ${response}=    Update Subscription
    ...    ${subscription_id}
    ...    ${subscription_fragment}
    ...    ${CONTENT_TYPE_MERGE_PATCH_JSON}
    ...    context=${ngsild_test_suite_context}
    Check Response Status Code    204    ${response['status']}
    Check Response Status Code    204    ${response.status_code}
    [Teardown]    Delete Subscription    ${subscription_id}
+22 −22
Original line number Diff line number Diff line
@@ -25,15 +25,15 @@ ${content_type}= application/json
    [Documentation]    Verify that on a GET HTTP request if nothing is specified on the Accept header, "application/json" is assumed (/entities/{entityId})
    [Tags]    e-query    6_3_4
    ${id}=    Generate Random Entity Id    ${building_id_prefix}
    ${request}    ${response}=    Create Entity Selecting Content Type
    ${response}=    Create Entity Selecting Content Type
    ...    ${building_filename}
    ...    ${id}
    ...    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    201    ${response['status']}
    ${request}    ${response}=    Query Entity    ${id}    context=${ngsild_test_suite_context}    accept=*/*
    Check Response Status Code    200    ${response['status']}
    Check Response Headers Containing Content-Type set to    ${response}    ${content_type}
    Check Response Headers Link Not Empty    ${response}
    Check Response Status Code    201    ${response.status_code}
    ${response}=    Query Entity    ${id}    context=${ngsild_test_suite_context}    accept=*/*
    Check Response Status Code    200    ${response.status_code}
    Check Response Headers Containing Content-Type set to    ${response.headers}    ${content_type}
    Check Response Headers Link Not Empty    ${response.headers}
    [Teardown]    Delete Entity by Id Returning Response    ${id}

044_02_02_endpoint /subscriptions/{subscriptionId}
@@ -41,11 +41,11 @@ ${content_type}= application/json
    [Tags]    sub-retrieve    6_3_4
    ${id}=    Generate Random Entity Id    ${subscription_id_prefix}
    ${response}=    Create Subscription    ${id}    ${subscription_filename}    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    201    ${response['status']}
    ${request}    ${response}=    Retrieve Subscription    ${id}    accept=*/*
    Check Response Status Code    200    ${response['status']}
    Check Response Headers Containing Content-Type set to    ${response}    ${content_type}
    Check Response Headers Link Not Empty    ${response}
    Check Response Status Code    201    ${response.status_code}
    ${response}=    Retrieve Subscription    ${id}    accept=*/*
    Check Response Status Code    200    ${response.status_code}
    Check Response Headers Containing Content-Type set to    ${response.headers}    ${content_type}
    Check Response Headers Link Not Empty    ${response.headers}
    [Teardown]    Delete Subscription    ${id}

044_02_03_endpoint /csourceRegistrations/
@@ -54,16 +54,16 @@ ${content_type}= application/json
    ${registration_id}=    Generate Random Entity Id    ${registration_id_prefix}
    ${payload}=    Load JSON From File    ${EXECDIR}/data/${registration_filename}
    ${updated_payload}=    Update Value To JSON    ${payload}    $..id    ${registration_id}
    ${request}    ${response}=    Create Context Source Registration With Return    ${updated_payload}
    Check Response Status Code    201    ${response['status']}
    ${request}    ${response}=    Query Context Source Registrations With Return
    ${response}=    Create Context Source Registration With Return    ${updated_payload}
    Check Response Status Code    201    ${response.status_code}
    ${response}=    Query Context Source Registrations With Return
    ...    id=${registration_id}
    ...    type=${registration_type}
    ...    context=${ngsild_test_suite_context}
    ...    accept=*/*
    Check Response Status Code    200    ${response['status']}
    Check Response Headers Containing Content-Type set to    ${response}    ${content_type}
    Check Response Headers Link Not Empty    ${response}
    Check Response Status Code    200    ${response.status_code}
    Check Response Headers Containing Content-Type set to    ${response.headers}    ${content_type}
    Check Response Headers Link Not Empty    ${response.headers}
    [Teardown]    Delete Context Source Registration    ${registration_id}

044_02_04_endpoint /temporal/entities
@@ -74,15 +74,15 @@ ${content_type}= application/json
    ...    ${temporal_entity_representation_id}
    ...    ${tea_filename}
    ...    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    201    ${response['status']}
    ${request}    ${response}=    Query Temporal Representation Of Entities With Return
    Check Response Status Code    201    ${response.status_code}
    ${response}=    Query Temporal Representation Of Entities With Return
    ...    entity_types=${teatype}
    ...    timerel=after
    ...    timeAt=2020-08-01T12:05:00Z
    ...    context=${ngsild_test_suite_context}
    ...    accept=*/*
    Check Response Status Code    200    ${response['status']}
    Check Response Status Code    200    ${response.status_code}
    Set Test Variable    ${response}
    Check Response Headers Containing Content-Type set to    ${response}    ${content_type}
    Check Response Headers Link Not Empty    ${response}
    Check Response Headers Containing Content-Type set to    ${response.headers}    ${content_type}
    Check Response Headers Link Not Empty    ${response.headers}
    [Teardown]    Delete Temporal Representation Of Entity    ${temporal_entity_representation_id}
+11 −11
Original line number Diff line number Diff line
@@ -26,17 +26,17 @@ ${content_type}= application/xml
    [Documentation]    Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (patch /entities/{entityId}/attrs/{attrId})
    [Tags]    ea-partial-update    6_3_4
    ${entity_id}=    Generate Random Entity Id    ${vehicle_id_prefix}
    ${request}    ${response}=    Create Entity Selecting Content Type
    ${response}=    Create Entity Selecting Content Type
    ...    ${vehicle_filename}
    ...    ${entity_id}
    ...    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    201    ${response['status']}
    Check Response Status Code    201    ${response.status_code}
    ${response}=    Partial Update Entity Attributes
    ...    ${entity_id}
    ...    ${vehicle_attribute}
    ...    ${vehicle_fragment}
    ...    ${content_type}
    Check Response Status Code    415    ${response['status']}
    Check Response Status Code    415    ${response.status_code}
    [Teardown]    Delete Entity by Id Returning Response    ${entity_id}

044_03_02_endpoint patch /subscriptions/{subscriptionId}
@@ -44,20 +44,20 @@ ${content_type}= application/xml
    [Tags]    sub-update    6_3_4
    ${id}=    Generate Random Entity Id    ${subscription_id_prefix}
    ${response}=    Create Subscription    ${id}    ${subscription_filename}    ${CONTENT_TYPE_LD_JSON}
    Check Response Status Code    201    ${response['status']}
    Check Response Status Code    201    ${response.status_code}
    ${response}=    Update Subscription    ${id}    ${subscription_fragment}    ${content_type}
    Check Response Status Code    415    ${response['status']}
    Check Response Status Code    415    ${response.status_code}
    [Teardown]    Delete Subscription    ${id}

044_03_03_endpoint post /entities/
    [Documentation]    Verify throwing 415 HTTP status code (Unsupported Media Type) if "Content-Type" header is not "application/json" or "application/ld+json" (post /entities/)
    [Tags]    e-create    6_3_4
    ${entity_id}=    Generate Random Entity Id    ${building_id_prefix}
    ${request}    ${response}=    Create Entity Selecting Content Type
    ${response}=    Create Entity Selecting Content Type
    ...    ${building_filename}
    ...    ${entity_id}
    ...    ${content_type}
    Check Response Status Code    415    ${response['status']}
    Check Response Status Code    415    ${response.status_code}
    [Teardown]    Delete Entity by Id    ${entity_id}

044_03_04_endpoint post /subscriptions/
@@ -65,7 +65,7 @@ ${content_type}= application/xml
    [Tags]    sub-create    6_3_4
    ${subscriptions_id}=    Generate Random Entity Id    ${subscription_id_prefix}
    ${response}=    Create Subscription    ${subscriptions_id}    ${subscription_filename}    ${content_type}
    Check Response Status Code    415    ${response['status']}
    Check Response Status Code    415    ${response.status_code}
    [Teardown]    Delete Subscription    ${subscriptions_id}

044_03_05_endpoint post /entityOperations/create
@@ -76,9 +76,9 @@ ${content_type}= application/xml
    ${first_entity}=    Load Entity    ${building_filename}    ${first_entity_id}
    ${second_entity}=    Load Entity    ${building_filename}    ${second_entity_id}
    @{entities_to_be_created}=    Create List    ${first_entity}    ${second_entity}
    Batch Create Entities    @{entities_to_be_created}    content_type=${content_type}
    ${response}=    Batch Create Entities    @{entities_to_be_created}    content_type=${content_type}
    @{expected_entities_ids}=    Create List    ${first_entity_id}    ${second_entity_id}
    Check Response Status Code Set To    415
    Check Response Status Code    415    ${response.status_code}
    [Teardown]    Batch Delete Entities    @{expected_entities_ids}

044_03_06_endpoint post /temporal/entities/
@@ -89,5 +89,5 @@ ${content_type}= application/xml
    ...    ${temporal_entity_representation_id}
    ...    ${tea_filename}
    ...    ${content_type}
    Check Response Status Code    415    ${response['status']}
    Check Response Status Code    415    ${response.status_code}
    [Teardown]    Delete Temporal Representation Of Entity    ${temporal_entity_representation_id}
Loading