Commit 5a6cfb9d authored by 张振华's avatar 张振华

Replace interface_check_tool.py

parent 14fae211
import requests import requests
...@@ -5,7 +5,6 @@ import requests ...@@ -5,7 +5,6 @@ import requests
import os import os
import sys import sys
#注意:此处需要按照本地实际的项目路径来填写
plugpath='/home/user/code/go/plugin/plugin' plugpath='/home/user/code/go/plugin/plugin'
command="ls $GOPATH/pkg/mod/github.com/33cn|tail -n 1" command="ls $GOPATH/pkg/mod/github.com/33cn|tail -n 1"
...@@ -178,7 +177,7 @@ def checkInterfacesByCid(cid): ...@@ -178,7 +177,7 @@ def checkInterfacesByCid(cid):
for line in open(cidFile): for line in open(cidFile):
#print(line) #print(line)
if flag == 0: #初始状态 if flag == 0: #初始状态
if line.find(u"请求报文[") != -1: if line.find(u"请求报文<") != -1:
flag = 1 flag = 1
req=line.split('[')[1].split(']')[0] req=line.split('[')[1].split(']')[0]
print(reqMsg) print(reqMsg)
...@@ -235,7 +234,7 @@ def checkInterfacesByCid(cid): ...@@ -235,7 +234,7 @@ def checkInterfacesByCid(cid):
flag = 4 flag = 4
file2.close() file2.close()
compareFields(subpath, method, reqMsg) compareFields(subpath, method, reqMsg)
cidResultFile.write('\t\t\t"method":"' + method + '",\n\t\t\t"msg":"' + reqMsg + '",\n') cidResultFile.write('\t\t\t"method":"' + method[0:len(method)-len(reqMsg) - 1] + '",\n\t\t\t"msg":"' + reqMsg + '",\n')
f=open(subpath+'/diff') f=open(subpath+'/diff')
content=f.read() content=f.read()
if len(content) == 0: if len(content) == 0:
...@@ -282,13 +281,13 @@ def collectResults(cids): ...@@ -282,13 +281,13 @@ def collectResults(cids):
file.write(',\n\t' + content) file.write(',\n\t' + content)
tmpFile.close() tmpFile.close()
file.write(']\n}\n') file.write('\t]\n}')
file.close() file.close()
cids = ['93', '94', '100','99','98','97','96','102','105','104','108','110','115','118','134','135'] cids = ['93', '94', '100','99','98','97','96','102','105','104','108','110','115','118','134','135']
#cids = ['93'] #cids = ['135']
for cid in cids: for cid in cids:
checkInterfacesByCid(cid) checkInterfacesByCid(cid)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment