feat:(策略对象新增修改)1:策略对象支持多个同时新增/修改

2.策略对象修改支持addItemList,updateItemList,deleteItemIds
3.策略对象支持enable,disable,只需要传入objectId,objectType
This commit is contained in:
wangxin
2020-06-18 16:29:17 +08:00
parent e8bab7c328
commit 19ed4e3d4a
5 changed files with 380 additions and 16 deletions

View File

@@ -9,21 +9,6 @@ Resource ../Common.robot
*** Variables ***
${url} /policy/compile
*** Keywords ***
#拼接字典类型数据为get请求的字符串
Dictionary-To-QueryParams
[Documentation]
... 接收get参数字典转换为请求字符串
[Arguments] ${params}
${paramsString} = Set Variable ${EMPTY}
FOR ${key} IN @{params}
${value} = Get From Dictionary ${params} ${key}
${paramStr} = Catenate SEPARATOR=\= ${key} ${value}
${len} = Get Length ${paramsString}
${paramsString} = Run Keyword If ${len} != 0 Catenate SEPARATOR=& ${paramsString} ${paramStr}
... ELSE Set Variable ${paramStr}
END
Log To Console ${paramsString}
[Return] ${paramsString}
#get查询策略传入字典对象该方法将字典对象自动拼接成get请求查询条件
QueryPolicies
[Documentation]
@@ -74,6 +59,7 @@ AddPolicies
${policyIds} Run Keyword If "${returnData}" == "1" WxGet-PolicyIds ${response}
... ELSE Create List
${rescode} Set Variable ${response['code']}
Should Be Equal As Strings ${rescode} 200
[Return] ${rescode} ${policyIds}
UpdatePolicies
[Arguments] ${returnData} ${policyList} ${version} ${opAction}
@@ -88,4 +74,5 @@ UpdatePolicies
... ELSE Set Variable ${EMPTY}
${response} BaseEditRequestForV2 ${url} ${body} ${version}
${rescode} Set Variable ${response['code']}
Should Be Equal As Strings ${rescode} 200
[Return] ${rescode}