def test_SA_bet_details_daily(self): route = data[120]["route"] url = "".join(base.get_url(route)) Method = data[120]["method"] params = eval(data[120]["params"]) res = get_this_month_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[120]["expect"], resp.json()["message"], msg="失败原因为%s != %s" % (data[120]["expect"], resp.json()["message"])) self.log.info("----------test is pass----------") self.log.info("----------test is end----------")
def test_get_livelist_this_month(self): res = get_this_month_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[110]["expect"], res.json()["message"], msg="失败原因%s != %s" % (data[110]["expect"], res.json()["message"])) self.log.info("----------test is pass----------") self.log.info("----------test is end----------")