本报告模板示例,是用Python的requests做的接口测试,返回的是json格式的response。
效果截图:(看清晰图,右键新窗口打开图片)
# encoding: utf-8
"""
@author: lileilei
@site:
@software: PyCharm
@file: py_Html.py
@time: 2017/6/5 17:04
"""
import os
titles='接口测试'
def title(titles):
title='''<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>%s</title>
<style type="text/css">
td{ width:40px; height:50px;}
</style>
</head>
<body>
'''%(titles)
return title
connent='''
<div style='width: 1170px;margin-left: 20%'>
<h1>接口测试的结果</h1>'''
def time(starttime,endtime,passge,fail):
beijing='''
<p&