add apitest
This commit is contained in:
parent
0ccd8c3d63
commit
51af678d37
13
bin/apitest
Executable file
13
bin/apitest
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../scripts/postman')
|
||||||
|
|
||||||
|
import apitest
|
||||||
|
|
||||||
|
workDir = os.getcwd()
|
||||||
|
test = apitest.ApiTest(workDir)
|
||||||
|
test.convert()
|
||||||
|
if len(sys.argv) > 1 and sys.argv[1] == 'run':
|
||||||
|
os.system('newman run ' + test.getOutFileName())
|
@ -5,10 +5,10 @@ import sys
|
|||||||
import json
|
import json
|
||||||
from urllib import parse as urlparse
|
from urllib import parse as urlparse
|
||||||
|
|
||||||
class Mocking(object):
|
class ApiTest(object):
|
||||||
|
|
||||||
def __init__(self, workDir):
|
def __init__(self, workDir):
|
||||||
self._workDir = workDir + '/mocking/'
|
self._workDir = workDir + '/tests/'
|
||||||
|
|
||||||
def convert(self):
|
def convert(self):
|
||||||
self._env = json.loads(open(self._workDir + 'env.json', 'r').read())
|
self._env = json.loads(open(self._workDir + 'env.json', 'r').read())
|
Loading…
x
Reference in New Issue
Block a user