def get_url(self, requestparam): """ 创建会话,获取response :param requestparam: :return: """ dic = dict() dic['requestParam'] = requestparam dic['source'] = int(Request().get_source()) signature = MD5().encodingpassword(MapUtil().get_signbase(dic, Request.separator()) + MD5().encodingpassword(Request.get_app_secret())) dic["signature"] = signature url = Request().get_host() + self.apiname + "?" + MapUtil().get_signbase(dic, Request.separator()) print("url: ", url) return url
def get_response(self, serial): url = Request().get_url(serial=serial, filename=self.filename, apiname=self.apiname) session = requests.session() response = session.post(url) return response
def get_response(self, serial): url = Request().get_url(serial=serial, filename=self.filename, apiname=self.apiname) response = requests.post(url=url) if response.status_code == 200: return response else: raise ConnectionRefusedError()
def setUp(self): self.filename = Request().dirname() + "/Document/B_Client/getQuoteDetail.json" self.filecontent = FileContent(filename=self.filename) self.apiname = self.filecontent.get_apiname() self.caselist = self.filecontent.get_caselist() self.verify = Verify()
def setUp(self): self.filename = Request().dirname( ) + "/Document/Public_Api/updateQuote.json" self.filecontent = FileContent(self.filename) self.apiname = self.filecontent.get_apiname() self.caselist = self.filecontent.get_caselist() self.verify = Verify()
def setUp(self): self.filename = Request().dirname() + "/Document/Wechat_Applet/getBrokerOrderRefundList.json" self.filecontent = FileContent(self.filename) self.apiname = self.filecontent.get_apiname() # 获取apiname用于获得url self.api = self.filecontent.get_api() # 获取api用于校验 self.caselist = self.filecontent.get_caselist() # 获取caselist列表,包括"reqParams"和"expectResult" # self.casenumber = self.filecontent.get_casenumber() # 获取case数量 self.verify = Verify()
def get_response(self, serial): """ :param serial: :return: 获取接口返回 """ url = Request().get_url(serial=serial, filename=self.filename, apiname=self.apiname) session = requests.session() response = session.post(url) return response
def setUp(self): self.filename = Request().dirname() + "/Document/Wechat_Applet/**" self.filecontent = FileContent(self.filename) self.apiname = self.filecontent.get_apiname() # 获取apiname用于获得url self.api = self.filecontent.get_api() # 获取api用于校验 self.caselist = self.filecontent.get_caselist() # 获取caselist列表,包括"reqParams"和"expectResult" self.verify = Verify() # self.result = GlobalVar().global_dic self.verificationErrors = []
def setUp(self): self.filename = Request().dirname( ) + "/Document/Public_Api/getAllBank.json" self.filecontent = FileContent(self.filename) self.apiname = self.filecontent.get_apiname() # 获取apiname用于获得url self.api = self.filecontent.get_api() # 获取api用于校验 self.caselist = self.filecontent.get_caselist( ) # 获取caselist列表,包括"reqParams"和"expectResult" self.verify = Verify()
def setUp(self): self.filename = Request().dirname() + "/Document/Wechat_Applet/queryBrokerOrderVoucher.json" # self.filename = os.path.abspath("../Document/Wechat_Applet/brokerGetCarSourceDetail.json") self.filecontent = FileContent(self.filename) self.apiname = self.filecontent.get_apiname() # 获取apiname用于获得url self.api = self.filecontent.get_api() # 获取api用于校验 self.caselist = self.filecontent.get_caselist() # 获取caselist列表,包括"reqParams"和"expectResult" # self.casenumber = self.filecontent.get_casenumber() # 获取case数量 self.verify = Verify()
def setUp(self): self.filename = Request().dirname() + "/Document/B_Client/publishBroker.json" self.filecontent = FileContent(self.filename) self.apiname = self.filecontent.get_apiname() # 获取apiname用于获得url self.api = self.filecontent.get_api() # 获取api用于校验 self.caselist = self.filecontent.get_caselist() # 获取caselist列表,包括"reqParams"和"expectResult" # self.casenumber = self.filecontent.get_casenumber() # 获取case数量 self.verify = Verify() self.verificationErrors = []
def setUp(self): self.filename = Request().dirname() + "/Document/Wechat_Applet/brokerVerifyCodeLogin.json" # self.filename = os.path.abspath("../Document/Wechat_Applet/brokerVerifyCodeLogin") self.filecontent = FileContent(self.filename) self.apiname = self.filecontent.get_apiname() self.api = self.filecontent.get_api() self.caselist = self.filecontent.get_caselist() self.verify = Verify() self.phone = "18867520068"
def setUp(self): self.filename = Request().dirname( ) + "/Document/B_Client/canPublishBrokerCarsrcList.json" self.filecontent = FileContent(self.filename) self.apiname = self.filecontent.get_apiname() self.api = self.filecontent.get_api() self.caselist = self.filecontent.get_caselist() self.verify = Verify() self.verificationError = []
def get_response(self, serial): """ 从json文件中读取请求参数 :param serial: :return: """ url = Request().get_url(serial=serial, apiname=self.apiname, filename=self.filename) response = requests.post(url) if response.status_code == 200: return response else: raise ConnectionRefusedError()
def get_response(self, serial): """ :param serial: :return: 获取接口返回 """ url = Request().get_url(serial=serial, filename=self.filename, apiname=self.apiname) session = requests.session() response = session.post(url, timeout=1) if response.status_code == 200: return response else: raise ConnectionRefusedError("request is refused.")
def get_response(self, serial): """ :param serial: :return: 获取接口返回 """ if 'sql' in self.filecontent.get_caselist()[serial]: SqlOperation().insert_data(self.json_converto_sql(serial)) url = Request().get_url(serial=serial, filename=self.filename, apiname=self.apiname) response = requests.post(url) return response
def setUp(self): self.filename = Request().dirname( ) + "/Document/Wechat_Applet/sendValidataCode.json" self.filecontent = FileContent(self.filename) self.apiname = self.filecontent.get_apiname() # 获取apiname用于获得url self.api = self.filecontent.get_api() # 获取api用于校验 self.caselist = self.filecontent.get_caselist( ) # 获取caselist列表,包括"reqParams"和"expectResult" # self.casenumber = self.filecontent.get_casenumber() # 获取case数量 self.verify = Verify() self.verificationErrors = []
def setUp(self): self.filename = Request().dirname( ) + "/Document/Wechat_Applet/getVirtualOrderList.json" self.filecontent = FileContent(self.filename) self.apiname = self.filecontent.get_apiname() # 获取apiname用于获得url self.api = self.filecontent.get_api() # 获取api用于校验 self.caselist = self.filecontent.get_caselist( ) # 获取caselist列表,包括"reqParams"和"expectResult" # self.casenumber = self.filecontent.get_casenumber() # 获取case数量 self.verify = Verify() self.verificationErrors = [] delete_sql = "DELETE FROM trans.trade_announcement_order" SqlOperation().delete_data(delete_sql)
def get_response(self, serial): """ :param serial: :return: 获取接口返回 """ print(self.apiname) url = Request().get_url(serial=serial, filename=self.filename, apiname=self.apiname) # session = requests.session() response = requests.post(url) if response.status_code == 200: return response else: raise ConnectionRefusedError()