Watch 1 Star 1 Fork 0

shadon / testsPythonApache-2.0

Sign up for free
Explore and code with more than 2 million developers,Free private repositories !:)
Sign up
Nothing here. spread retract

Clone or download 1.42 KB
Copy Edit Web IDE Raw Blame History
fenghaikun authored 2017-12-05 11:47 . 调整代码
#!/usr/bin/evn python
# -*- coding:utf-8 -*-
import time
import unittest
import os
from shadon.HTMLTestRunner import HTMLTestRunner
from shadon.testsGetApi import testGetApi
class index():
# 生成测试报告
def index(self):
global filename ,rootDir
filename = 'null'
rootDir = os.path.dirname(__file__)
case_path = rootDir+'/src/'
ptint_path = rootDir+'/print'
discover =,pattern='test*.py')
filename = ptint_path +'/'+ time.strftime("%Y-%m-%d %H_%M_%S") + '_result.html'
fp = open(filename,'wb')
runner = HTMLTestRunner(stream=fp,title='接口测试报告:',description='测试用例:')
# 生成测试文件
def build(self):
getApiOb = testGetApi()
modules = getApiOb.getApiMoudle()
for list in modules:
apiClass =getApiOb.getClassName(list)
for list1 in apiClass:
apiFunction =getApiOb.getFunction(list, list1)
for list2 in apiFunction:
if list2 != 'accessToken':
getApiOb.setApiFile(list, list1,list2)
if __name__ == "__main__":
shadon = index()

Comment ( 0 )

You need to Sign in for post a comment

Help Search