From: garciadeblas Date: Mon, 20 Jun 2022 21:32:40 +0000 (+0200) Subject: Revert "Fix warnings with RequestsLibrary related to Post Request and Get Request" X-Git-Tag: v12.0.0rc1~6 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F26%2F12226%2F1;p=osm%2Ftests.git Revert "Fix warnings with RequestsLibrary related to Post Request and Get Request" This reverts commit cc3f879f1dadc08ab63ef2d11d80d6ae8e5edea6. Change-Id: I46700e1bcf8395bb691ad907d1b73b70b264ef7b Signed-off-by: garciadeblas --- diff --git a/robot-systest/lib/sol003_common_lib.robot b/robot-systest/lib/sol003_common_lib.robot index 7d3d73d..795a1a3 100644 --- a/robot-systest/lib/sol003_common_lib.robot +++ b/robot-systest/lib/sol003_common_lib.robot @@ -22,6 +22,7 @@ Library OperatingSystem Resource %{ROBOT_DEVOPS_FOLDER}/lib/vim_lib.robot *** Variables *** +&{HEADERS} Content-Type=application/json Accept=application/json &{data} username=admin password=admin project-id=admin @{success_status_code_list} 200 201 202 204 ${descriptor_content_type_gzip} application/gzip @@ -37,8 +38,7 @@ Get Auth Token Get Hostname Create Session osmhit ${HOST} Log Many ${auth_token_uri} @{data} ${data} - &{headers} Create Dictionary Content-Type=application/json Accept=application/json - ${resp}= Post On Session osmhit ${auth_token_uri} data=${data} headers=${HEADERS} + ${resp}= Post Request osmhit ${auth_token_uri} data=${data} headers=${HEADERS} log ${resp} Pass Execution If ${resp.status_code} in ${success_status_code_list} Get Auth Token completed Set Suite Variable ${token_status_code} ${resp.status_code} @@ -49,26 +49,26 @@ Get Auth Token Set Dockerized Host [Arguments] ${env_host} - Set Suite Variable ${HOST} https://${env_host} + Set Suite Variable ${HOST} https://${env_host} Set Standalone Host [Arguments] ${env_host} - Set Suite Variable ${HOST} https://${env_host}:9999 + Set Suite Variable ${HOST} https://${env_host}:9999 Read Directory - [Documentation] To Read Current Direct ory - ${Directory}= Replace String ${CURDIR} lib resources/ - ${json_path}= Set Variable ${Directory} + [Documentation] To Read Current Direct ory + ${Directory}= Replace String ${CURDIR} lib resources/ + ${json_path}= Set Variable ${Directory} [Return] ${JsonPath} Post Api Request [Arguments] ${PostApi} [Documentation] Keword to Post API Request - Create Session APISession ${HOST} - &{headers} Create Dictionary Content-Type=application/json Accept=application/json Authorization=Bearer ${access_token} - ${request_response}= Post On Session APISession ${PostApi} data=${updated_json_obj} headers=${headers} - Set Suite Variable ${request_response} - ${response_statuscode} Convert To String ${request_response.status_code} + Create Session APISession ${HOST} + &{headers} Create Dictionary Content-Type=application/json Accept=application/json Authorization=Bearer ${access_token} + ${request_response}= Post Request APISession ${PostApi} data=${updated_json_obj} headers=${headers} + Set Suite Variable ${request_response} + ${response_statuscode} Convert To String ${request_response.status_code} Set Suite Variable ${response_statuscode} Get HostName @@ -97,7 +97,7 @@ Get Api Request [Documentation] Keyword to Get API Request Create Session Session ${HOST} &{headers} Create Dictionary Content-Type=application/json Accept=application/json Authorization=Bearer ${access_token} - ${request_response}= Get On Session Session ${uri} headers=${Headers} + ${request_response}= Get Request Session ${uri} headers=${Headers} Set Suite Variable ${request_response} ${response_statuscode} Convert To String ${request_response.status_code} Set Suite Variable ${response_statuscode}