Verified Commit d4eff8cf authored by Johannes Visintini's avatar Johannes Visintini
Browse files

add verbose parameter

parent 48288acb
......@@ -63,7 +63,7 @@ Status Amount
% python3 -h
usage: [-h] [-a API_VERSION] [-b BASE_URL] [-r REQUESTS_JSON] [-d]
usage: [-h] [-a API_VERSION] [-b BASE_URL] [-r REQUESTS_JSON] [-d] [-v]
test ohsome API based on available paths in swagger files
......@@ -76,4 +76,5 @@ optional arguments:
use the requests in this file instead of getting them from swagger files
-d, --debug show debug output
-v, --verbose show more verbose output
......@@ -53,7 +53,7 @@ def perform_requests(test_requests, args):
r =['url'], data=request['parameters'])
if r.status_code != 200 or args.debug:
if r.status_code != 200 or args.debug or args.verbose:
tqdm.write('{} {}: {}'.format(request['method'], r.status_code, r.url))
if request['method'] == 'POST':
tqdm.write(' → {:.200}'.format(str(request['parameters'])))
......@@ -78,6 +78,7 @@ if __name__ == '__main__':
parser.add_argument('-b', '--base-url', type=str, default='', help='base url')
parser.add_argument('-r', '--requests-json', type=str, help='use the requests in this file instead of getting them from swagger files')
parser.add_argument('-d', '--debug', action='store_true', help='show debug output')
parser.add_argument('-v', '--verbose', action='store_true', help='show more verbose output')
args = parser.parse_args()
if args.api_version:
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