From 3e390386c3c1d1e1efdfc7d31972f7a1762d1b0f Mon Sep 17 00:00:00 2001 From: wangxin Date: Wed, 1 Jul 2020 12:03:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:(v1=E7=89=88=E6=9C=AC=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=88=86=E9=9A=94=E7=AC=A6)=E5=BC=95=E7=94=A8=E5=AF=B9?= =?UTF-8?q?=E8=B1=A1=E4=BD=BF=E7=94=A8=E5=8F=98=E9=87=8F=E5=88=86=E9=9A=94?= =?UTF-8?q?=E7=AC=A6=20feat:(=E7=AD=96=E7=95=A5=E5=AF=B9=E8=B1=A1)1.?= =?UTF-8?q?=E7=AD=96=E7=95=A5=E5=AF=B9=E8=B1=A1=E7=9B=B8=E5=85=B3=E6=80=A7?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2;2.App=20ID=E5=AF=B9=E8=B1=A1=E6=A0=91?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../policy_object/PolicyObjectTests.robot | 12 ++++++++++-- .../tsg_bfapi/policy_object/Object.robot | 16 ++++++++++++++++ 02-Keyword/tsg_common/ManagePolicyBody.robot | 18 +++++++++++++----- 3 files changed, 39 insertions(+), 7 deletions(-) diff --git a/01-TestCase/tsg_bfapi/policy_object/PolicyObjectTests.robot b/01-TestCase/tsg_bfapi/policy_object/PolicyObjectTests.robot index e284a87..8c22e40 100644 --- a/01-TestCase/tsg_bfapi/policy_object/PolicyObjectTests.robot +++ b/01-TestCase/tsg_bfapi/policy_object/PolicyObjectTests.robot @@ -593,7 +593,15 @@ Policy-Statistics-v1-00035 Comment 策略统计 ${objectIds} Set Variable ${EMPTY} ${response} StatisticsPolicies -Policy-ProtocolFields-v1-00035 +Policy-ProtocolFields-v1-00036 Comment 策略对象生效协议字段查询 ${objectIds} Set Variable ${EMPTY} - ${response} PolicProtocolFields tsg_security ${EMPTY} ip \ No newline at end of file + ${response} PolicProtocolFields tsg_security ${EMPTY} ip +Object-Reference-v1-00037 + Comment 策略对象生效协议字段查询 + ${objectIds} Set Variable ${EMPTY} + ${response} ObjectReference 174 +Object-AppIDTree-v1-00038 + Comment 策略对象生效协议字段查询 + ${objectIds} Set Variable ${EMPTY} + ${response} AppIdTreeSearch 174 \ No newline at end of file diff --git a/02-Keyword/tsg_bfapi/policy_object/Object.robot b/02-Keyword/tsg_bfapi/policy_object/Object.robot index 67cd4bc..7b39309 100644 --- a/02-Keyword/tsg_bfapi/policy_object/Object.robot +++ b/02-Keyword/tsg_bfapi/policy_object/Object.robot @@ -199,4 +199,20 @@ PolicProtocolFields ${response} BaseFormRequest ${objectUrl}/protocolFields ${parmStr} ${version} ${rescode} Set Variable ${response['code']} Should Be Equal As Strings ${rescode} 200 + [Return] ${response['data']} +ObjectReference + [Documentation] + ... 策略对象相关性查询 + [Arguments] ${objectId} + ${response} BaseFormRequest ${objectUrl}/reference objectId=${objectId} ${version} + ${rescode} Set Variable ${response['code']} + Should Be Equal As Strings ${rescode} 200 + [Return] ${response['data']} +AppIdTreeSearch + [Documentation] + ... App ID对象树查询 + [Arguments] ${referenceObjectId} + ${response} BaseFormRequest ${objectUrl}/appId/tree referenceObjectId=${referenceObjectId} ${version} + ${rescode} Set Variable ${response['code']} + Should Be Equal As Strings ${rescode} 200 [Return] ${response['data']} \ No newline at end of file diff --git a/02-Keyword/tsg_common/ManagePolicyBody.robot b/02-Keyword/tsg_common/ManagePolicyBody.robot index e185aa1..073d144 100644 --- a/02-Keyword/tsg_common/ManagePolicyBody.robot +++ b/02-Keyword/tsg_common/ManagePolicyBody.robot @@ -4,7 +4,15 @@ Library Collections Resource ../../03-Variable/BifangApiVariable.txt Resource ../../03-Variable/PolicyObjectDefault.txt Resource ../../02-Keyword/tsg_bfapi/PolicyObject.robot - +*** Variables *** +#arraySplitor:数组元素之间的分隔符 +${arraySplitor} , +#protocolFiledSplitor:protocolFiled之间的分隔符 +${protocolFiledSplitor} & +#objectIdSplitor:objectId之间的分隔符 +${objectIdSplitor} : +#idFiledSplitor: objectId和protocolFiled之间的分隔符 +${idFiledSplitor} | *** Keywords *** # ... 特殊参数说明: # ... effectiveRange=Nursurtan|Transtelecom&Astel,Almaty&Nursurtan,|Astel&Transtelecom @@ -243,12 +251,12 @@ AnalysisReferenceObject # 解析引用对象 [Arguments] ${referenceObject} ${objList} Create List - ${list} Evaluate re.split('[,]', '${referenceObject}') re + ${list} Evaluate re.split('[${arraySplitor}]', '${referenceObject}') re FOR ${var} IN @{list} ${emptyList} Create List ${emptyObj} Create Dictionary - ${key} Evaluate '${var}'[0:'${var}'.find('|')] - ${values} Evaluate '${var}'['${var}'.find('|')+1:] + ${key} Evaluate '${var}'[0:'${var}'.find('${idFiledSplitor}')] + ${values} Evaluate '${var}'['${var}'.find('${idFiledSplitor}')+1:] ${valueList} InnerForEach ${values} ${key} Run Keyword If '${key}'.isdigit() Evaluate int('${key}') ... ELSE Set Variable ${key} @@ -262,7 +270,7 @@ InnerForEach # 循环嵌套 [Arguments] ${values} ${emptyList} Create List - ${list} Evaluate re.split('[&]', '${values}') re + ${list} Evaluate re.split('[${protocolFiledSplitor}]', '${values}') re FOR ${var} IN @{list} Append To List ${emptyList} ${var} END