From 57de2c7a98b4c9bef7087190e774ff4a43630f07 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Mon, 15 Jun 2020 15:34:29 +0800 Subject: [PATCH] fix: convert har to JSON format testcase --- docs/CHANGELOG.md | 1 + httprunner/ext/har2case/__init__.py | 2 +- httprunner/ext/har2case/core.py | 2 -- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index a58035c6..06b8d1c5 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -5,6 +5,7 @@ **Fixed** - fix: avoid '.csv' been converted to '_csv' +- fix: convert har to JSON format testcase ## 3.0.12 (2020-06-14) diff --git a/httprunner/ext/har2case/__init__.py b/httprunner/ext/har2case/__init__.py index c1a074b4..4a503962 100644 --- a/httprunner/ext/har2case/__init__.py +++ b/httprunner/ext/har2case/__init__.py @@ -67,7 +67,7 @@ def main_har2case(args): if args.to_yaml: output_file_type = "YAML" - elif args.to_yaml: + elif args.to_json: output_file_type = "JSON" else: output_file_type = "pytest" diff --git a/httprunner/ext/har2case/core.py b/httprunner/ext/har2case/core.py index 3c491cf5..acb62951 100644 --- a/httprunner/ext/har2case/core.py +++ b/httprunner/ext/har2case/core.py @@ -338,8 +338,6 @@ class HarParser(object): capture_exception(ex) raise - logger.debug("prepared testcase: {}".format(testcase)) - if file_type == "JSON": output_testcase_file = f"{harfile}.json" utils.dump_json(testcase, output_testcase_file)