Fix "SyntaxError: EOL while scanning string literal"
[integration/test.git] / csit / libraries / Utils.robot
index 0d6f09ec2b4166473750357969350f86cd4f1c1d..919da36a04d5850d5b6e44eac767741dbcc5ba0c 100644 (file)
@@ -70,7 +70,7 @@ Report_Failure_Due_To_Bug
     ...    or as the first line of the test if FastFail module is not being
     ...    used. It reports the URL of the bug on console and also puts it
     ...    into the Robot log file.
-    ${test_skipped}=    BuiltIn.Evaluate    len(re.findall('SKIPPED', '''${TEST_MESSAGE}''')) > 0    modules=re
+    ${test_skipped}=    BuiltIn.Evaluate    len(re.findall('SKIPPED', """${TEST_MESSAGE}""")) > 0    modules=re
     BuiltIn.Return From Keyword If    ('${TEST_STATUS}' != 'FAIL') or ${test_skipped}
     ${newline}=    BuiltIn.Evaluate    chr(10)
     ${msg}=    BuiltIn.Set_Variable    This test fails due to https://bugs.opendaylight.org/show_bug.cgi?id=${number}
@@ -336,6 +336,21 @@ Add Elements To URI From File
     ${resp}    RequestsLibrary.Put Request    session    ${dest_uri}    data=${body}    headers=${headers}
     Should Be Equal As Strings    ${resp.status_code}    200
 
+Add Elements To URI From File And Verify
+    [Arguments]    ${dest_uri}    ${data_file}    ${headers}=${headers}
+    ${body}    OperatingSystem.Get File    ${data_file}
+    ${resp}    RequestsLibrary.Put Request    session    ${dest_uri}    data=${body}    headers=${headers}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${resp}    RequestsLibrary.Get Request    session    ${dest_uri}
+    Should Not Be Equal    ${resp.status_code}    404
+
+Add Elements To URI And Verify
+    [Arguments]    ${dest_uri}    ${data_file}    ${headers}=${headers}
+    ${resp}    RequestsLibrary.Put Request    session    ${dest_uri}    ${data_file}    headers=${headers}
+    Should Be Equal As Strings    ${resp.status_code}    200
+    ${resp}    RequestsLibrary.Get Request    session    ${dest_uri}
+    Should Not Be Equal    ${resp.status_code}    404
+
 Post Elements To URI From File
     [Arguments]    ${dest_uri}    ${data_file}    ${headers}=${headers}
     ${body}    OperatingSystem.Get File    ${data_file}