def test_AG_bet_details_daily(self): route = data[86]["route"] url = "".join(base.get_url(route)) Method = data[86]["method"] params = eval(data[86]["params"]) res = get_this_week_list.BetRecord().get_betrecord_list().json( )["data"]["list"] for d in res: date = d["date"]["date"] params["date"] = date headers = {"Authorization": get_token.GetRes().get_res()} kwargs = {"params": params, "headers": headers} resp = base.get_response(url, Method, **kwargs) self.log.info("----------test is start----------") self.log.info("请求的接口地址为: %s" % resp.url) self.log.info("请求的参数为: %s" % kwargs) self.log.info("响应内容为: %s" % resp.json()) self.log.info("响应状态码为: %s" % resp.status_code) self.assertEqual(data[86]["expect"], resp.json()["message"], msg="失败原因为%s != %s" % (data[86]["expect"], resp.json()["message"])) self.log.info("----------test is pass----------") self.log.info("----------test is end----------")
def test_get_livelist_this_week(self): res = get_this_week_list.BetRecord().get_betrecord_list() # 本周视讯投注记录 self.log.info("----------test is start----------") self.log.info("请求的接口地址为 %s" % res.url) self.log.info("响应内容为: %s" % res.json()) self.log.info("响应状态码为: %s" % res.status_code) self.assertEqual(data[84]["expect"], res.json()["message"], msg="失败原因%s != %s" % (data[84]["expect"], res.json()["message"])) self.log.info("----------test is pass----------") self.log.info("----------test is end----------")