Clean up PcepOperations 08/110908/1
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 20 Mar 2024 17:35:38 +0000 (18:35 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 20 Mar 2024 17:35:38 +0000 (18:35 +0100)
Use named arguments. Switch to POST On Session. Add a missing slash.

Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Change-Id: I042aa9e802721304f09e3a1952c032d3bf7877b9

csit/libraries/PcepOperations.robot

index 5b324bbfbcf488aa08b7a2105392718719ac1d10..2becc1c17062cab315ab9613c72e96a7b4adb916 100644 (file)
@@ -26,7 +26,7 @@ Setup_Pcep_Operations
     # 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
+    ...    url=http://${ODL_SYSTEM_IP}:${RESTCONFPORT}/rests/operations/
     ...    headers=${HEADERS_XML}
     ...    auth=${AUTH}
 
@@ -59,7 +59,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    pcep_session    uri=${uri_part}    data=${xml_data}    expect_status=any
     Log    ${xml_data}
     Should Contain    ${ALLOWED_STATUS_CODES}    ${response.status_code}
     RETURN    ${response.text}