def get_for_xxx(self, param_1, param_2): LogUtil.step(u"--- 通过API xxxx {} {}".format(param_1, param_2)) params = { "param_1": param_1, "param_2": param_2, } rsp = MyRequests.get(self.GET_API, params=params) return rsp.json().get('data')
def post_for_xxx(self, param_1, param_2): LogUtil.step(u"--- 通过API xxxx {} {}".format(param_1, param_2)) data = { "param_1": param_1, "param_2": param_2, } req = MyRequests.post(self.POST_API, data=data, is_json=True) return req.json().get('code'), req.json().get('msg'), req.json().get('data')
def test_1(self): """\ 说明\ <br> 步骤与校验\ <br> 1. 步骤 校验\ <br> 2. 步骤 校验\ <br> 3. 步骤 校验\ """ LogUtil.step(u"步骤1") param = self.db_cont_ops.get_first_info(1, 'name') LogUtil.verify(u"校验1") self.verify_1(param)