管理服务接口升级关键字以及用例提交
This commit is contained in:
@@ -11,6 +11,9 @@ Library DatabaseLibrary
|
||||
|
||||
*** Variables ***
|
||||
${objectUrl} /policy/object
|
||||
${categoryUrl} /category/dict
|
||||
${applicationDictUrl} /application/update/dict
|
||||
${fileUploaduRL} /system/feature/update/
|
||||
|
||||
*** Keywords ***
|
||||
AddObjects
|
||||
@@ -61,6 +64,25 @@ UpdateObjects
|
||||
${rescode} Set Variable ${response['code']}
|
||||
Should Be Equal As Strings ${rescode} 200
|
||||
[Return] ${rescode}
|
||||
|
||||
UpdateInstall
|
||||
[Arguments] ${updateDict}
|
||||
[Documentation] 更新策略对象
|
||||
... objectList,策略对象,可为list类型与dict类型
|
||||
... addItemList自动过滤itemId
|
||||
... updateItemList自动过滤isInitialize(update时该字段引发异常)
|
||||
... ipItem格式为dict,自动过滤空的字段
|
||||
... stringItem格式为dict,需要注意keywordArray字段应传入逗号分隔的字符串eg: keyword1,keyword2
|
||||
... http_signature为代表的拓展关键字keywordArray字段也是以逗号分隔的
|
||||
... returnData,是否返回数据,固定为1
|
||||
... opAction,可为update,enable,disable
|
||||
#必选参数判定
|
||||
Should Not Be Empty ${updateDict}
|
||||
${bodyJson} json.Dumps ${updateDict} ensure_ascii=False
|
||||
${response} BaseEditRequestForV2 ${fileUploaduRL} ${body} ${version}
|
||||
${rescode} Set Variable ${response['code']}
|
||||
Should Be Equal As Strings ${rescode} 200
|
||||
[Return] ${rescode}
|
||||
|
||||
GetObjectItems
|
||||
[Arguments] ${params}
|
||||
@@ -154,7 +176,28 @@ ImportObject
|
||||
${rescode} Set Variable ${response['code']}
|
||||
Should Be Equal As Strings ${rescode} 200
|
||||
[Return] ${rescode} ${objectType} ${response}
|
||||
|
||||
|
||||
ImportApplication
|
||||
[Arguments] ${filePath} ${fileName} ${feature} ${code}
|
||||
[Documentation] 策略对象导入
|
||||
... filePath文件路径
|
||||
... fileName文件名称
|
||||
... feature是特征
|
||||
Directory Should Exist ${path}
|
||||
File Should Exist ${path}/${filePath}/${fileName}
|
||||
File Should Not Be Empty ${path}/${filePath}/${fileName}
|
||||
${size} Get File Size ${path}/${filePath}/${fileName}
|
||||
${binFile} Run Keyword If "${feature}"=="${EMPTY}" Evaluate (r'${fileName}',open(r"${path}/${filePath}/${fileName}",'rb'),'application/xml')
|
||||
... ELSE IF "${feature}"=="app_library" or "${feature}"=="app_signature" Evaluate (r'${fileName}',open(r"${path}/${filePath}/${fileName}",'rb'),'application/octet-stream')
|
||||
... ELSE ${EMPTY}
|
||||
${file} Create Dictionary file=${binFile}
|
||||
# ${response} BaseMultipartPostRequest ${objectUrl}/batch ${EMPTY} ${file} ${version}
|
||||
${response} Run Keyword If "${feature}"=="${EMPTY}" BaseMultipartPostRequest ${applicationDictUrl} ${EMPTY} ${file} ${version}
|
||||
... ELSE IF "${feature}"=="app_library" or "${feature}"=="app_signature" BaseMultipartPostRequest ${fileUploaduRL} ${EMPTY} ${file} ${version}
|
||||
${rescode} Set Variable ${response['code']}
|
||||
Should Be Equal As Strings ${rescode} ${code}
|
||||
|
||||
|
||||
ExportObject
|
||||
[Arguments] ${objectType} ${objectSubType} ${objectIds} ${objectName}
|
||||
[Documentation] 策略对象导出
|
||||
@@ -240,3 +283,37 @@ AppIdTreeSearch
|
||||
${rescode} Set Variable ${response['code']}
|
||||
Should Be Equal As Strings ${rescode} 200
|
||||
[Return] ${response['data']}
|
||||
|
||||
AddCategories
|
||||
[Arguments] ${returnData} ${categoryList}
|
||||
[Documentation] 新增策略对象
|
||||
... objectList,策略对象,可为list类型与dict类型
|
||||
... addItemList自动过滤itemId
|
||||
... updateItemList自动过滤isInitialize(update时该字段引发异常)
|
||||
... ipItem格式为dict,自动过滤空的字段
|
||||
... stringItem格式为dict,需要注意keywordArray字段应传入逗号分隔的字符串eg: keyword1,keyword2
|
||||
... http_signature为代表的拓展关键字keywordArray字段也是以逗号分隔的
|
||||
... returnData,是否返回数据,固定为1
|
||||
Comment 此处思路给category单独的另一套关键字,原因:地址与json串名称与Object部分不同了
|
||||
${returnData}= Run Keyword If '${returnData}' == '${EMPTY}' Set Variable 1
|
||||
... ELSE Set Variable ${returnData}
|
||||
#必选参数判定
|
||||
Should Not Be Empty ${categoryList}
|
||||
${dictType} = Evaluate type(${categoryList})
|
||||
${body} Run Keyword If "${dictType}" == "<class 'list'>" CategoryListOperation ${returnData} ${categoryList} add
|
||||
... ELSE IF "${dictType}" == "<class 'dict'>" CategoryOperation ${returnData} ${categoryList} add
|
||||
... ELSE Set Variable ${EMPTY}
|
||||
${response} BasePostRequestForV2 ${categoryUrl} ${body} ${version}
|
||||
${CategoryIds} Run Keyword If "${returnData}" == "1" Get-CategoryIds ${response}
|
||||
... ELSE Create List
|
||||
${rescode} Set Variable ${response['code']}
|
||||
Should Be Equal As Strings ${rescode} 200
|
||||
[Return] ${rescode} ${CategoryIds}
|
||||
|
||||
QueryUpadateRecord
|
||||
[Arguments] ${body} ${code}
|
||||
${response} BaseGetRequestOK /${version}/system/feature/update body=${body}
|
||||
log ${response}
|
||||
${rescode} Set Variable ${response['code']}
|
||||
Shoule Be Equal As Strings ${rescode} ${code}
|
||||
[Return] ${rescode}
|
||||
|
||||
Reference in New Issue
Block a user