コード例 #1
0
 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
コード例 #2
0
 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
コード例 #3
0
 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()
コード例 #4
0
    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()
コード例 #5
0
    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()
コード例 #6
0
    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()
コード例 #7
0
    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
コード例 #8
0
    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 = []
コード例 #9
0
    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()
コード例 #10
0
    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()
コード例 #11
0
    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 = []
コード例 #12
0
    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"
コード例 #13
0
    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 = []
コード例 #14
0
 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()
コード例 #15
0
    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.")
コード例 #16
0
    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
コード例 #17
0
    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 = []
コード例 #18
0
    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)
コード例 #19
0
    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()