From 3d1416262202c99f464be5089b49d483f99b4ae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E6=98=8E=E6=98=8E?= Date: Mon, 1 Jun 2020 19:25:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9CreatePolicyFile=E5=85=B3?= =?UTF-8?q?=E9=94=AE=E5=AD=97=E4=B8=8E=E6=B7=BB=E5=8A=A0CreateRequest?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FunctionalKeywords.robot | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot b/02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot index a0736d1..38ef7b1 100644 --- a/02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot +++ b/02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot @@ -206,14 +206,15 @@ TeardownDelete CreatePolicyFile4 - [Arguments] ${url} ${filePath} ${objectDict} - ${binFile} Evaluate open(r"${path}/${filePath}${objectDict}[contentName]",'rb') + [Arguments] ${url} ${filePath} ${fileName} ${objectDict} + [Timeout] + ${binFile} Evaluate open(r"${path}/${filePath}${fileName}",'rb') ${fileDict} Create Dictionary file=${binFile} - ${requestData} Create Dictionary name="file" filename="${objectDict}[contentName]" Content-Type=application/octet-stream + ${requestData} Create Dictionary name="file" filename="${fileName}" Content-Type=application/octet-stream ${suffix} Generate Random String ${profileName} Catenate SEPARATOR=_ test ${suffix} log ${objectDict} - ${string} Convert To String ${objectDict} + ${string} Convert To String ${objectDict} ${fileDesc} Create Dictionary File-Desc=${string} log ${fileDesc}[File-Desc] ${content} UpFilePostRequest ${url} ${requestData} ${fileDict} ${fileDesc} @@ -224,5 +225,18 @@ CreatePolicyFile4 ${response} Create Dictionary msg=${msg} profileId=${profileId} profileName=${profileName} Log add operation:${msg} Log profileId:${profileId} + [Return] ${response} - +CreateRequest + [Arguments] ${url} ${data} + [Documentation] 必传参数:url + ... 可选参数:data(不传时使用默认值) + ${content} Post-Request ${url} ${data} + ${msg} Set Variable ${content['msg']} + ${list} Set Variable ${content['data']['list']} + ${profileId} Set Variable ${list[0]['profileId']} + ${profileName} Set Variable ${list[0]['profileName']} + ${response} Create Dictionary msg=${msg} profileId=${profileId} profileName=${profileName} + Log add operation:${msg} + Log profileId:${profileId} + [Return] ${response}