Example #1
0
def sheet_name_Path():
    global_config = Global()
    sheet=global_config.get_sheet()
    if sheet==0:      
        path=u'前端接口'
        return path
    elif sheet==1:
        path=u'后台接口'
        return path
Example #2
0
__author__ = 'zuozhijun'

import datetime
import unittest

from runcase import RunCase
from globalconfig import Global
from htmlreport import HtmlReport

if __name__ == '__main__':
    # 记录测试开始时间
    start_time = datetime.datetime.now()

    # 全局配置
    global_config = Global()
    run_mode = global_config.get_run_mode()  # 运行模式
    run_case_list = global_config.get_run_case_list()  # 需要运行的用例列表
    db1_conn = global_config.get_db1_conn()  # 数据库连接
    db2_conn = global_config.get_db2_conn()  # 数据库连接
    http = global_config.get_http()  # http

    # 运行测试用例
    runner = unittest.TextTestRunner()
    case_runner = RunCase()
    case_runner.run_case(runner, run_mode, run_case_list, db1_conn, db2_conn,
                         http)

    # 记录测试结束时间
    end_time = datetime.datetime.now()
Example #3
0
def sheet_number_Path():
    global_config = Global()
    sheet=global_config.get_sheet()
    return sheet
#import Special_char_process
import copy
import mysql.connector
from globalconfig import Global

global_config = Global()
db1_conn = global_config.get_db1_conn()
#
#预期结果为sql语句查询情况时,对查询结果进行字典化:查询字段属性名为字典键,查询值组成列表为字典值
# def ExpectedResults_dict_SqlQuery(Param_Sql):
#     try:
#         # conn = mysql.connector.connect(host='127.0.0.1', port='3306', user='******', password='******', database='test',
#         #                                charset='utf8')
#         # print("conn", conn)
#         # cur = conn.cursor()  # buffered=True
#         # print("cur", cur)
#         db1_conn=global_config.get_db1_conn()
#         db1_cursor=db1_conn.cursor()
#         db1_cursor.execute(Param_Sql)  # .fetchone()
#         Query_Result = db1_cursor.fetchall()
#         print("Query_Result", Query_Result)
#         column_name = db1_cursor.description  # 获取数据表列名
#         print("column_name", column_name)
#         char_list=[]
#         for char_list_num in range(len(column_name)):
#             char_list.append(column_name[char_list_num][0])#查询属性字段组成列表
#         print("char_list",char_list)
#         column_name_temp_list = []
#         Query_Result_dict = {}
#         # for k in index:
#         # print("k",k[0])