def get_data(): """读yaml文件数据""" lis = [] # data = GetData.get_yml_data("sum.yml") # 静态方法调用 data = GetData().get_yml_data("sum.yml") for i in data.values(): lis.append(tuple(i.values())) return lis
def login_data(): # 空列表 login_list = [] data = GetData().get_yml_data("login.yml") for i in data.values(): login_list.append((i.get("name"), i.get("pwd"), i.get("toast"), i.get("exp"))) return login_list
def search_data(): """组装搜索测试数据""" # [("1", "休眠"), ("m", "MAC地址"), ("w", "WPS按钮")] # 存储数据列表 search_value = [] data = GetData().get_yml_data("search.yml") for i in data.values(): search_value.append(tuple(i.values())) return search_value
def get_yaml(): # 空列表 data_l = [] # 返回yaml文件中的数据 data = GetData().get_yml_data("sum.yml") # 获取data字典的所有value for i in data.values(): # 解析组装数据 data_l.append(tuple(i.values())) return data_l
def get_yaml(): data_l = [] # with open("G:\\Users\Lenovo\PycharmProjects\sh_app13_day10_1\Data\sum.yml","r") as f: # with open(r"./Data/sum.yml", "r") as f: # with open(r"./Data"+os.sep+"sum.yml", "r") as f: data = GetData().get_yml_data("sum.yml") # data=yaml.safe_load(f) # print("data={}".format(data)) for i in data.values(): data_l.append(tuple(i.values())) print(data_l) return data_l