From c2c4023d1e1e4ee00b6874b27d983bed95493b36 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 15 Nov 2021 15:33:43 +0800 Subject: [PATCH] add mock script --- bin/mock | 11 +++++++++++ scripts/postman/__init__.py | 0 scripts/postman/mocking.py | 11 +++++++++++ 3 files changed, 22 insertions(+) create mode 100755 bin/mock create mode 100644 scripts/postman/__init__.py create mode 100644 scripts/postman/mocking.py diff --git a/bin/mock b/bin/mock new file mode 100755 index 0000000..bb4a7e7 --- /dev/null +++ b/bin/mock @@ -0,0 +1,11 @@ +#!/usr/bin/python + +import os +import sys +sys.path.append( os.path.dirname(os.path.abspath(__file__)) + '/../scripts/postman') + +import mocking + +workDir = os.getcwd() +mock = mocking.Mocking(workDir) +mock.convert() diff --git a/scripts/postman/__init__.py b/scripts/postman/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/scripts/postman/mocking.py b/scripts/postman/mocking.py new file mode 100644 index 0000000..7a2d760 --- /dev/null +++ b/scripts/postman/mocking.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- + +import json + +class Mocking(object): + + def __init__(self, workDir): + self._workDir = workDir + '/mocking/' + + def convert(self): + self._env = json.loads(open(self._workDir + 'env.json', 'r').read())