From ab634e5c63fb0340b7e2c8a0c806cb24cda5ee2d Mon Sep 17 00:00:00 2001 From: dongxiaoyan Date: Mon, 29 Mar 2021 09:30:27 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=B3=A8=E9=87=8A=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E5=86=85=E5=AE=B9=EF=BC=9B=202=E3=80=81=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=8B=BC=E6=8E=A5=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6=E8=A6=81?= =?UTF-8?q?=E6=B1=82=EF=BC=8C@=E6=B5=81=E6=B5=AA=E8=BF=9C=E6=96=B9?= =?UTF-8?q?=E9=9C=80=E6=A0=B9=E6=8D=AE=E8=A6=81=E6=B1=82=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=EF=BC=9B=203=E3=80=81=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=9C=89=E7=9B=AE=E6=A0=87=E7=B2=BE=E7=A1=AE=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E7=BB=93=E6=9E=9C=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 04-CustomLibrary/Custometest/Schema.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/04-CustomLibrary/Custometest/Schema.py b/04-CustomLibrary/Custometest/Schema.py index 524878c..858b03b 100644 --- a/04-CustomLibrary/Custometest/Schema.py +++ b/04-CustomLibrary/Custometest/Schema.py @@ -3,7 +3,7 @@ import requests import random import json -import allure +#import allure number = random.randint(0,100000) str = random.choice('abcdefghijklmnopqrstuvwxyz') list = [] @@ -15,14 +15,24 @@ def schema(schemauerl,token): return response.json() #根据schema接口返回数据,得出所有属性所支持的比较类型的列表 +#1、根据[doc][allow_query]值为true列支持搜索; +#2、如有[doc][constraints][operator_functions]值,操作优先; +#3、如有[doc][data]值则对应属性取值为data所列code值; +#4、int和long的范围不一致; +#5、string要包含特殊字符 +#6、给查询条件赋值,要给出边界和正常值 +#7、IP(V4、V6)和URL要给出专门的方法生成 def Filter1(schemauerl,token): json_str = schema(schemauerl,token) print(type(json_str)) + #获取日志属性定义 fields = json_str["data"]["fields"] + #获取不同属性支持的部不同操作 operator = json_str["data"]["doc"]["schema_query"]["references"]["operator"] for i in fields: name = i["name"] doc = i["doc"] + #获取无任何特殊说明列: if doc == None: type1 = i["type"] for j in operator: