def get_parameter(name, case): #将tools封装成函数 data = tools1.parse() # print(data) param = data[name][case]["request"] # # print(param) return param
def caselist(): #获取整理完的数据接口名,传yaml名 data = tools1.parse() keylist = [] for n in data[1:]: keylist.extend(list(n.keys())) return keylist
def casedata(casename): #获取yaml文件中的casename的数据,传casename获得data数据 data = tools1.parse() data1 = data[caselist().index(casename) + 1] url = data1[casename]["request"]["url"] data = data1[casename]["request"]["json"] header = data1[casename]["request"]["headers"] print(url, data, header) return url, data, header
def casedata(casename): #获取yaml文件中的casename的数据,传casename获得data数据 data = tools1.parse() data1= data[caselist().index(casename)+1] # print(data1) url =data1[casename]["request"]["url"] data = data1[casename]["request"]["json"] header = data1[casename]["request"]["headers"] # a = data["gddjId"] # print("processInstanceId" in data.keys()) # print(a is not None) # print(a) return url, data, header
def get_parameter(name): #将tools封装成函数 data = tools1.parse() param = data[name]["test"]["request"] return param