diff --git a/bin/apitest b/bin/apitest new file mode 100755 index 0000000..505f3a8 --- /dev/null +++ b/bin/apitest @@ -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()) diff --git a/scripts/postman/mocking.py b/scripts/postman/apitest.py similarity index 98% rename from scripts/postman/mocking.py rename to scripts/postman/apitest.py index 18fd72e..a1dd0e0 100644 --- a/scripts/postman/mocking.py +++ b/scripts/postman/apitest.py @@ -5,10 +5,10 @@ import sys import json from urllib import parse as urlparse -class Mocking(object): +class ApiTest(object): def __init__(self, workDir): - self._workDir = workDir + '/mocking/' + self._workDir = workDir + '/tests/' def convert(self): self._env = json.loads(open(self._workDir + 'env.json', 'r').read())