當前位置: 首頁>>代碼示例>>Python>>正文


Python Base.getApiType方法代碼示例

本文整理匯總了Python中Src.Function.Base.Base.getApiType方法的典型用法代碼示例。如果您正苦於以下問題:Python Base.getApiType方法的具體用法?Python Base.getApiType怎麽用?Python Base.getApiType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Src.Function.Base.Base的用法示例。


在下文中一共展示了Base.getApiType方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: update_fail_num

# 需要導入模塊: from Src.Function.Base import Base [as 別名]
# 或者: from Src.Function.Base.Base import getApiType [as 別名]
 def update_fail_num(self, if_name):
     """
     更新Fail_num字段
     :param if_name:
     :return:
     """
     type = Base.getApiType(self, if_name)
     sql = "UPDATE api_pass_rate_wph SET url_target='" + url_target + "',`type`='" + type + "',fail_num=fail_num+1 WHERE if_name = '" + if_name + "';"
     return Base.query(self, sql)
開發者ID:xcma,項目名稱:selenium,代碼行數:11,代碼來源:api_pass_rate_wph.py

示例2: update_pass_num

# 需要導入模塊: from Src.Function.Base import Base [as 別名]
# 或者: from Src.Function.Base.Base import getApiType [as 別名]
 def update_pass_num(self, if_name):
     type = Base.getApiType(self, if_name)
     sql = "UPDATE api_pass_rate_wph SET url_target='" + url_target + "',`type`='" + type + "',pass_num=pass_num+1 WHERE if_name = '" + if_name + "';"
     return Base.query(self, sql)
開發者ID:xcma,項目名稱:selenium,代碼行數:6,代碼來源:api_pass_rate_wph.py

示例3: set_test_result

# 需要導入模塊: from Src.Function.Base import Base [as 別名]
# 或者: from Src.Function.Base.Base import getApiType [as 別名]
    def set_test_result(cls, response, status_code, interfacename, casename, comment, result):
        """
        存入測試結果
        :param response:
        :param status_code:
        :param interfacename:
        :param casename:
        :param comment:
        :param result:
        :param main:
        :return:
        """
        base = Base()
        tr = test_result()
        tr.__init__()
        status = ''
        res_time = ''
        main = Run.Main
        type = base.getApiType(interfacename)

        try:
            res_time = Misc.read_from_file('res_time')[0]
            status = response['succ']
            cls.response_new = 'succ:%s' % response['succ']
            try:
                if response['succ'] != '1':
                    # 有可能不存在msg,try一下
                    cls.response_new = response['msg']
            except:
                pass
        except:
            status = status_code
            cls.response_new = Base.todo_string(response)
        finally:
            try:
                if main in 'api':

                    # 操作 api_pass_rate表
                    if result in 'Fail':
                        if 'xx' in url_target:
                            apr.update_fail_num(interfacename)
                        else:
                            aprwph.update_fail_num(interfacename)
                    else:
                        if 'xx' in url_target:
                            apr.update_pass_num(interfacename)
                        else:
                            aprwph.update_pass_num(interfacename)

                    # 操作api_performance表
                    if int(res_time) > 0.3:
                        status = 'Fail'
                    else:
                        status = 'Pass'
                    data = {
                        "if_name": interfacename,
                        "case_name": casename,
                        "res_time": res_time,
                        "type": type,
                        "status": status,
                    }
                    ap.insert_apiPerformance(data)

                # 操作test_result表
                data = {
                    "if_name": interfacename,
                    "case_name": casename,
                    "comment": comment,
                    "status": status,
                    "result": result,
                    "response": cls.response_new,
                    "url_target": url_target,
                    "type": type,
                    "main": main,
                }
                tr.insert_testResult(data)

            except Exception as msg:
                print (msg)
                raise
開發者ID:xcma,項目名稱:selenium,代碼行數:82,代碼來源:test_result.py


注:本文中的Src.Function.Base.Base.getApiType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。