def test_CQ9_bet_details_daily(self): route = data[141]["route"] url = "".join(base.get_url(route)) Method = data[141]["method"] params = eval(data[141]["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[141]["expect"], resp.json()["message"], msg="失败原因为%s != %s" % (data[141]["expect"], resp.json()["message"])) self.log.info("----------test is pass----------") self.log.info("----------test is end----------")
def __init__(self): self.token = get_token.GetRes().get_res()
def setUp(self): self.log = logger.Log() self.token = get_token.GetRes().get_res()