def setUpClass(cls): cls_name = cls.__name__ cls.data_dict = json_dict.json_to_dict(os.path.dirname(os.path.dirname(__file__)) + '/json_file/wood_data.json') cls.url = cls.data_dict[cls.env]['host'] + cls.data_dict[cls.env][cls_name]['api'] cls.headers = cls.data_dict[cls.env][cls_name]['headers'].copy() cls.data = cls.data_dict[cls.env][cls_name]['data'] cls.response = cls.data_dict[cls.env][cls_name]['response']
def setUpClass(cls): cls_name = cls.__name__ cls.data_dict = (json_dict.json_to_dict(os.path.dirname(os.path.dirname(__file__)) + '/json_file/wood_data.json'))[cls.env] cls.url = cls.data_dict['host'] + cls.data_dict[cls_name]['api'] cls.headers = cls.data_dict[cls_name]['headers'] if cls.env == 'pro': cls.headers['authorization'] = cls.data_dict['authorization'] else: cls.headers[cls.env + '-authorization'] = cls.data_dict[cls.env + '-authorization'] cls.para = cls.data_dict[cls_name]['para']