Commit 2a17e3b1 authored by Benoit Orihuela's avatar Benoit Orihuela
Browse files

chore: integrate Robocop format with minimal configuration

parent ccd430cd
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
repos:
  - repo: https://github.com/MarketSquare/robotframework-tidy
    id: robotidy
    rev: 4.11.0
  - repo: https://github.com/MarketSquare/robotframework-robocop
    rev: v6.9.2
    hooks:
      - id: robotidy
      - id: robocop-format
+3 −3
Original line number Diff line number Diff line
@@ -401,9 +401,9 @@ To launch a run configuration, choose one of the two configurations from the Run
### Pre commit

Before each commit, a formatting according to the rules of 
[Robotidy](https://github.com/MarketSquare/robotframework-tidy) is done for files with the `.robot` or `.resource` 
[Robocop](https://robocop.readthedocs.io/en/stable/index.html) is done for files with the `.robot` or `.resource` 
extension. If nothing has been modified, the commit is done normally. Otherwise, the commit displays an error message 
with all the modifications made by Robotidy to format the file. Modified files can then be added to the commit.
with all the modifications made by Robocop to format the file. Modified files can then be added to the commit.

To use it, install `pre-commit` with the following commands (using pip):

@@ -417,7 +417,7 @@ Now, it will run automatically on every commit.

To manually launch the tool, the following command can be used:

```$ python -m robotidy .```
```$ robocop format```

Further details can be found on the [pre-commit](https://pre-commit.com) site.

+5 −5
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration


*** Test Cases ***
043_01_01 Create entity
043_01_01 Create Entity
    [Documentation]    Verify receiving 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create entity)
    [Tags]    e-create    cb-ldcontext    5_2_2
    ${entity_id}=    Generate Random Building Entity Id
@@ -34,7 +34,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration
    Check Response Body Containing ProblemDetails Element Containing Title Element    ${response.json()}
    [Teardown]    Delete Entity by Id    ${entity_id}

043_01_02 Create subscription
043_01_02 Create Subscription
    [Documentation]    Verify receiving 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create subscription)
    [Tags]    sub-create    cb-ldcontext    5_2_2
    ${subscription_id}=    Generate Random Subscription Id
@@ -46,7 +46,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration
    Check Response Body Containing ProblemDetails Element Containing Title Element    ${response.json()}
    [Teardown]    Delete Subscription    ${subscription_id}

043_01_03 Create Temporal Representation of Entities
043_01_03 Create Temporal Representation Of Entities
    [Documentation]    Verify receiving 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create Temporal Representation of Entities)
    [Tags]    te-create    cb-ldcontext    5_2_2
    ${temporal_entity_representation_id}=    Generate Random Vehicle Entity Id
@@ -61,7 +61,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration
    Check Response Body Containing ProblemDetails Element Containing Title Element    ${response.json()}
    [Teardown]    Delete Temporal Representation Of Entity    ${temporal_entity_representation_id}

043_01_04 Batch entity create
043_01_04 Batch Entity Create
    [Documentation]    Verify receiving 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Batch entity create)
    [Tags]    be-create    cb-ldcontext    5_2_2
    ${first_entity_id}=    Generate Random Building Entity Id
@@ -84,7 +84,7 @@ ${registration_filename}= csourceRegistrations/context-source-registration
    ...    ${response.json()['errors'][1]['error']}
    [Teardown]    Batch Delete Entities    entities_ids_to_be_deleted=@{entities_ids_to_be_created}

043_01_05 Create context source registration
043_01_05 Create Context Source Registration
    [Documentation]    Verify receiving 503 – LdContextNotAvailable error if remote JSON-LD @context cannot be retrieved (Create context source registration)
    [Tags]    csr-create    cb-ldcontext    5_2_2
    ${registration_id}=    Generate Random CSR Id
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ ${attribute_id}= brandName


*** Test Cases ***
044_01_01 endpoint /entities/{entityId}/attrs/{attrId}
044_01_01 Endpoint /entities/{entityId}/attrs/{attrId}
    [Documentation]    Verify that PATCH HTTP requests can be done with "application/merge-patch+json" as Content-Type
    [Tags]    ea-partial-update    cb-mergepatch    6_3_4
    ${response}=    Partial Update Entity Attributes
+5 −5
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ ${status_code}= 406


*** Test Cases ***
049_01_01 Endpoint get /entities/{entityId}
049_01_01 Endpoint Get /entities/{entityId}
    [Documentation]    Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /entities/{entityId})
    [Tags]    e-query    cb-noacceptable-medtype    6_3_4
    ${entity_id}=    Generate Random Building Entity Id
@@ -28,7 +28,7 @@ ${status_code}= 406
    Check Response Status Code    ${status_code}    ${response.status_code}
    [Teardown]    Delete Entity by Id    ${entity_id}

049_01_02 Endpoint get /subscriptions/{subscriptionId}
049_01_02 Endpoint Get /subscriptions/{subscriptionId}
    [Documentation]    Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /subscriptions/{subscriptionId})
    [Tags]    sub-retrieve    cb-noacceptable-medtype    6_3_4
    ${id}=    Generate Random Subscription Id
@@ -38,19 +38,19 @@ ${status_code}= 406
    Check Response Status Code    ${status_code}    ${response.status_code}
    [Teardown]    Delete Subscription    ${id}

049_01_03 Endpoint get /csourceRegistrations/
049_01_03 Endpoint Get /csourceRegistrations/
    [Documentation]    Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceRegistrations/)
    [Tags]    csr-query    cb-noacceptable-medtype    6_3_4
    ${response}=    Query Context Source Registrations With Return    type=Building    accept=${accept}
    Check Response Status Code    ${status_code}    ${response.status_code}

049_01_04 Endpoint get /csourceSubscriptions/
049_01_04 Endpoint Get /csourceSubscriptions/
    [Documentation]    Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /csourceSubscriptions/)
    [Tags]    csrsub-query    cb-noacceptable-medtype    6_3_4
    ${response}=    Query Context Source Registration Subscriptions    accept=${accept}
    Check Response Status Code    ${status_code}    ${response.status_code}

049_01_05 Endpoint get /temporal/entities
049_01_05 Endpoint Get /temporal/entities
    [Documentation]    Verify throwing 406 HTTP status code (Not Acceptable Media Type) if the "Accept" header does not imply "application/json" nor "application/ld+json" (get /temporal/entities)
    [Tags]    te-query    cb-noacceptable-medtype    6_3_4
    ${entity_types_to_be_retrieved}=    Catenate    SEPARATOR=,    Vehicle
Loading