added mso delete option & string encoder 27/29127/1
authorTal Karbachinsky <talka@amdocs.com>
Thu, 25 Jan 2018 08:27:17 +0000 (10:27 +0200)
committerTal Karbachinsky <talka@amdocs.com>
Thu, 25 Jan 2018 08:32:07 +0000 (10:32 +0200)
Issue-ID: TEST-75
Change-Id: If4e6ff74bafb63ca73f6be6f6dc32b165b0ed9d8
Signed-off-by: Tal Karbachinsky <talka@amdocs.com>
robot/resources/json_templater.robot
robot/resources/mso_interface.robot

index 6a5ca17..4788fe5 100644 (file)
@@ -18,4 +18,11 @@ Fill JSON Template File
     [Arguments]    ${json_file}    ${arguments}
     ${json}=    OperatingSystem.Get File    ${json_file}
     ${returned_json}=  Fill JSON Template    ${json}    ${arguments}
-    [Return]    ${returned_json}
\ No newline at end of file
+    [Return]    ${returned_json}
+
+Encode String
+   [Documentation]    Encodes String
+   [Arguments]    ${json}
+   ${returned_string}=    string encoder    ${json}
+   log    ${returned_string}
+   [Return]    ${returned_string}
\ No newline at end of file
index 6bc6229..db776d4 100644 (file)
@@ -62,3 +62,19 @@ Run MSO Post request
        ${resp}=        Post Request    mso     ${data_path}     data=${data}   headers=${headers}
        Log    Received response from mso ${resp.text}
        [Return]  ${resp}
+
+Run MSO Delete request
+    [Documentation]    Runs an MSO Delete request
+    [Arguments]  ${data_path}  ${data}
+    sleep    2
+    ${auth}=    Create List    ${GLOBAL_MSO_USERNAME}    ${GLOBAL_MSO_PASSWORD}
+    Log    Creating session ${MSO_ENDPOINT}
+    ${session}=    Create Session    mso    ${MSO_ENDPOINT}    auth=${auth}
+    ${uuid}=    Generate UUID
+    ${headers}=    Create Dictionary    Accept=application/json    Content-Type=application/json    X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid}    X-FromAppId=${GLOBAL_APPLICATION_ID}
+    log    ${data}
+    ${data1}    Encode String    ${data}
+    log    ${data1}
+    ${resp}=    Delete Request    mso    ${data_path}    ${data1}    headers=${headers}
+    Log    Received response from mso ${resp.text}
+    [Return]    ${resp}