Exemple #1
0
def  get_Message_push(pass_list,fail_list):
    passnum = int(len(pass_list))
    failnum = int(len(fail_list))
    countnum = passnum + failnum
    pass_result = "%.2f%%" % (passnum / countnum * 100)
    fail_result = "%.2f%%" % (failnum / countnum * 100)
    content = "此次一共运行接口个数为%s个," \
              "\n通过个数为%s个," \
              "\n失败个数为%s个," \
              "\n通过率为%s," \
              "\n失败率为%s," \
              "\n详情请查看邮件!" \
              % (countnum, passnum, failnum, pass_result, fail_result)
    test = get_format_time("")+"测试报告"
    data = 'text=%s&desp=%s'%(test,content)
    re = requests.get('http://sc.ftqq.com/SCU17696T36793e999732a8b734d8016268bdfb4f5a2a4357f3dee.send'
                      , params=data).json()
    if re['errno']!=0:
        logging.error("发送失败,请更改发送参数")
    else:
        logging.debug("公众号推送成功")
Exemple #2
0
def get_run_logs_path():
    logs_format = get_time_value.get_format_time("yyyy-mm-dd")
    run_logs_path = get_logs_folder_path() + "/Logs.{value}.log".format(value=logs_format)
    return run_logs_path
Exemple #3
0
def get_log_report_path():
    log_format = get_time_value.get_format_time("")
    log_report_path = get_temp_folder_path() + "/RunLog({value}).html".format(value=log_format)
    return log_report_path
Exemple #4
0
def get_html_report_path():
    report_format = get_time_value.get_format_time("")
    report_path = get_temp_folder_path() + "/Reports({value}).html".format(value=report_format)
    return report_path
Exemple #5
0
def get_report_zip_path():
    report_format = get_time_value.get_format_time("")
    report_zip_path = get_report_folder_path() + "/Reports({value}).zip".format(value=report_format)
    return report_zip_path