This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
dongxiaoyan-tsg-autotest/01-TestCase/tsg_bfapi/geolocation/DictCrease.robot
2020-06-19 11:44:46 +08:00

52 lines
3.0 KiB
Plaintext

*** Settings ***
Test Teardown TeardownDelete ${url} geoNameIds ${geoNameId}
Force Tags tsg_bf_api dict_create #Suite Teardown Delete All Sessions
Library String
Resource ../../../02-Keyword/tsg_bfapi/policy_file_interface/FunctionalKeywords.robot
Resource ../../../03-Variable/BifangApiVariable.txt
Resource ../../../03-Variable/Policy_Objects_Module.txt
Library Custometest
*** Variables ***
${url} /${version}/geolocation/dict
${geoNameId} ${EMPTY}
*** Test Cases ***
dictcrease-01
${objectedit} Create Dictionary geoNameId=1001
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${settig_proxy_profiles_geolocation_dictcrease} ${objectedit}
log ${objectDict}
${response} CreateRequest_locationId ${url} ${objectDict}
# 查询
${geoNameId} Get From Dictionary ${response} geoNameId
#log ${geoNameId}
#${locationId} Get From Dictionary ${response} locationId
#log ${locationId}
QueryPolicyFile ${url} geoNameId=${geoNameId}
#QueryPolicyFile ${url} locationId=${locationId}
# 修改
${reqData_edit} Set Variable {"opAction":"update","returnData":1,"list":[{"locationId":1,"addrType":4,"startIp":"221.178.125.0","endIp":"221.178.125.255","geoNameId":"1001","latitude":22.4984,"longitude":112.9947,"coords":1000,"language":"Chinese (zh-CN)","continentAbbr":"AS","continentFull":"Asia","countryAbbr":"CN","countryFull":"China","provinceAbbr":"GD","provinceFull":"Guangdong","cityFull":"shenzhen","timeZone":"Asia/Shanghai"}]}
UpdatePolicyFile2 ${url} ${reqData_edit}
[Teardown] log to console ${\n}
dictcrease-02
${objectedit} Create Dictionary geoNameId=1001
Comment 打印需要修改的json内容
log ${objectedit}
${objectDict} Jsoneditmanu ${settig_proxy_profiles_geolocation_dictcreases} ${objectedit}
log ${objectDict}
${response} CreateRequest_locationId ${url} ${objectDict}
# 查询
${geoNameId} Get From Dictionary ${response} geoNameId
#log ${geoNameId}
#${locationId} Get From Dictionary ${response} locationId
#log ${locationId}
QueryPolicyFile ${url} geoNameId=${geoNameId}
#QueryPolicyFile ${url} locationId=${locationId}
# 修改
${reqData_edit} Set Variable {"opAction":"update","returnData":1,"list":[{"locationId":1,"addrType":4,"startIp":"221.178.125.0","endIp":"221.178.125.255","geoNameId":"1001","latitude":22.4984,"longitude":112.9947,"coords":1000,"language":"Chinese (zh-CN)","continentAbbr":"AS","continentFull":"Asia","countryAbbr":"CN","countryFull":"China","provinceAbbr":"GD","provinceFull":"Guangdong","cityFull":"shenzhen","timeZone":"Asia/Shanghai"}]}
UpdatePolicyFile2 ${url} ${reqData_edit}
[Teardown] log to console ${\n}