Library RequestsLibrary
Variables ../../../variables/Variables.py
Resource ../../../libraries/Utils.robot
+Resource ../../../libraries/TemplatedRequests.robot
*** Test Cases ***
Add Service Functions
${jsonbody} To Json ${body}
${functions} Get From Dictionary ${jsonbody} service-functions
${resp} RequestsLibrary.Get Request session ${SERVICE_FUNCTIONS_URI}
- Should Be Equal As Strings ${resp.status_code} 200
+ Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
${result} To JSON ${resp.content}
${function} Get From Dictionary ${result} service-functions
Lists Should be Equal ${function} ${functions}
${body} OperatingSystem.Get File ${SERVICE_FUNCTIONS_FILE}
Add Elements To URI From File ${SERVICE_FUNCTIONS_URI} ${SERVICE_FUNCTIONS_FILE}
${resp} RequestsLibrary.Get Request session ${SERVICE_FUNCTIONS_URI}
- Should Be Equal As Strings ${resp.status_code} 200
+ Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
Remove All Elements At URI ${SERVICE_FUNCTIONS_URI}
${resp} RequestsLibrary.Get Request session ${SERVICE_FUNCTIONS_URI}
Should Be Equal As Strings ${resp.status_code} 404
Add Elements To URI From File ${SERVICE_FUNCTIONS_URI} ${SERVICE_FUNCTIONS_FILE}
Remove All Elements At URI ${SERVICE_FUNCTIONS_URI}service-function/dpi-102-1
${resp} RequestsLibrary.Get Request session ${SERVICE_FUNCTIONS_URI}
- Should Be Equal As Strings ${resp.status_code} 200
+ Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
Should Not Contain ${resp.content} dpi-102-1
Delete A Non-existing Empty Service Function
${functions} Get From Dictionary ${jsonbody} service-functions
Remove All Elements At URI ${SERVICE_FUNCTIONS_URI}service-function/non-existing-sf
${resp} RequestsLibrary.Get Request session ${SERVICE_FUNCTIONS_URI}
- Should Be Equal As Strings ${resp.status_code} 200
+ Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
${result} To JSON ${resp.content}
${function} Get From Dictionary ${result} service-functions
Lists Should be Equal ${function} ${functions}
Remove All Elements At URI ${SERVICE_FUNCTIONS_URI}
Add Elements To URI From File ${SF_DPI102100_URI}sf-data-plane-locator/dpl-101 ${SF_DPL101_FILE}
${resp} RequestsLibrary.Get Request session ${SERVICE_FUNCTIONS_URI}
- Should Be Equal As Strings ${resp.status_code} 200
+ Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
Should Contain ${resp.content} dpi-102-100
${elements}= Create List dpl-101 10101
Check For Elements At URI ${SF_DPI102100_URI}sf-data-plane-locator/dpl-101 ${elements}
Add Elements To URI From File ${SF_DPI102100_URI} ${SF_DPI102100_FILE}
Remove All Elements At URI ${SF_DPI102100_URI}sf-data-plane-locator/dpl-100
${resp} RequestsLibrary.Get Request session ${SF_DPI102100_URI}
- Should Be Equal As Strings ${resp.status_code} 200
+ Should Contain ${ALLOWED_STATUS_CODES} ${resp.status_code}
Should Not Contain ${resp.content} dpl-100
Clean Datastore After Tests