3 Library RequestsLibrary
4 Resource ../CommonKeywords/HttpRequest.robot
5 Resource EngineAddr.robot
9 [Arguments] ${packageName} ${codeFlag}=1
10 [Documentation] ${packageName} :The data type is string!
11 ${headers} create dictionary Content-Type=application/json
12 create session microservices ${engineHost} ${headers}
13 ${deleteUrl} set variable ${engineUrl}/${packageName}
14 ${deleteResponse} delete request microservices ${deleteUrl}
15 log ${deleteResponse.content}
16 run keyword if ${codeFlag}==1 Should be equal as strings ${deleteResponse.status_code} 200
17 run keyword if ${codeFlag}!=1 Should be equal as strings ${deleteResponse.status_code} 499
18 [Return] ${deleteResponse}
21 [Arguments] ${checkContent} ${codeFlag}=1
22 ${response} httpPost ${engineHost} ${engineUrl} ${checkContent}
23 log ${response.content}
24 run keyword if ${codeFlag}==1 Should be equal as strings ${response.status_code} 200
25 run keyword if ${codeFlag}!=1 Should be equal as strings ${response.status_code} 499
29 [Arguments] ${jsonParams} ${codeFlag}=1
30 ${response} httpPut ${engineHost} ${engineUrl} ${jsonParams}
31 log ${response.content}
32 run keyword if ${codeFlag}==1 Should be equal as strings ${response.status_code} 200
33 run keyword if ${codeFlag}!=1 Should be equal as strings ${response.status_code} 499