def __init__(self): self.url = 'http://api.csslcloud.net/api/rooms/publishing?' dataList = LiveAPIData.publiShingData(self) check_data = dataList[0] t = THQS.thqs() check_data = t.get_thqs(check_data) self.check_url = self.url + check_data self.live = LiveAPIRequests.LiveAPIRequests
def setUp(self): '''初始化请求数据url''' url = 'http://api.csslcloud.net/api/rooms/publishing?' # 调用存数据文件,获取查询成功,参数错误和加密错误的数据 dataList = LiveAPIData.publiShingData(self) check_data, fail_data, encrypt_data = dataList[0], dataList[ 1], dataList[2] # 实例化加密方法 t = THQS.thqs() # 调用加密方法对测试数据进行加密 check_data = t.get_thqs(check_data) fail_data = t.get_thqs(fail_data) encrypt_data = t.get_thqs(encrypt_data) # 拼接url和加密后的请求数据 self.check_url = url + check_data self.fail_url = url + fail_data self.encrypt_url = url + encrypt_data + "1" # 实例化处理请求的类 self.live = LiveAPIRequests.LiveAPIRequests