Use explicit RequestsLibrary.Create_Session reference
[integration/test.git] / csit / libraries / PcepOperations.robot
index 5b324bbfbcf488aa08b7a2105392718719ac1d10..6cc315e05ea759397af812f3dcc8f06391c43a60 100644 (file)
@@ -23,10 +23,9 @@ ${PCEP_VAR_FOLDER}      ${CURDIR}/../variables/tcpmd5user
 *** Keywords ***
 Setup_Pcep_Operations
     [Documentation]    Creates Requests session to be used by subsequent keywords.
-    # Do not append slash at the end uf URL, Requests would add another, resulting in error.
-    Create_Session
-    ...    pcep_session
-    ...    http://${ODL_SYSTEM_IP}:${RESTCONFPORT}/rests/operations
+    RequestsLibrary.Create_Session
+    ...    alias=pcep_session
+    ...    url=http://${ODL_SYSTEM_IP}:${RESTCONFPORT}/rests/operations/
     ...    headers=${HEADERS_XML}
     ...    auth=${AUTH}
 
@@ -59,7 +58,7 @@ Remove_Xml_Lsp_Return_Json
 Operate_Xml_Lsp_Return_Json
     [Documentation]    Post XML data to given pcep-operations URI, check status_code is 200 and return response text (JSON).
     [Arguments]    ${uri_part}    ${xml_data}
-    ${response}=    RequestsLibrary.Post Request    pcep_session    ${uri_part}    data=${xml_data}
+    ${response}=    RequestsLibrary.POST On Session    alias=pcep_session    url=${uri_part}    data=${xml_data}    expected_status=any
     Log    ${xml_data}
     Should Contain    ${ALLOWED_STATUS_CODES}    ${response.status_code}
     RETURN    ${response.text}