mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-12 11:19:39 +08:00
change: add origin yaml/json testcase path in generated python testcases
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
# NOTICE: Generated By HttpRunner. DO'NOT EDIT!
|
# NOTICE: Generated By HttpRunner. DO'NOT EDIT!
|
||||||
|
# FROM: examples/httpbin/basic.yml
|
||||||
from httprunner import HttpRunner, TConfig, TStep
|
from httprunner import HttpRunner, TConfig, TStep
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# NOTICE: Generated By HttpRunner. DO'NOT EDIT!
|
# NOTICE: Generated By HttpRunner. DO'NOT EDIT!
|
||||||
|
# FROM: examples/httpbin/hooks.yml
|
||||||
from httprunner import HttpRunner, TConfig, TStep
|
from httprunner import HttpRunner, TConfig, TStep
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# NOTICE: Generated By HttpRunner. DO'NOT EDIT!
|
# NOTICE: Generated By HttpRunner. DO'NOT EDIT!
|
||||||
|
# FROM: examples/httpbin/load_image.yml
|
||||||
from httprunner import HttpRunner, TConfig, TStep
|
from httprunner import HttpRunner, TConfig, TStep
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# NOTICE: Generated By HttpRunner. DO'NOT EDIT!
|
# NOTICE: Generated By HttpRunner. DO'NOT EDIT!
|
||||||
|
# FROM: examples/httpbin/upload.yml
|
||||||
from httprunner import HttpRunner, TConfig, TStep
|
from httprunner import HttpRunner, TConfig, TStep
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# NOTICE: Generated By HttpRunner. DO'NOT EDIT!
|
# NOTICE: Generated By HttpRunner. DO'NOT EDIT!
|
||||||
|
# FROM: examples/httpbin/validate.yml
|
||||||
from httprunner import HttpRunner, TConfig, TStep
|
from httprunner import HttpRunner, TConfig, TStep
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# NOTICE: Generated By HttpRunner. DO'NOT EDIT!
|
# NOTICE: Generated By HttpRunner. DO'NOT EDIT!
|
||||||
|
# FROM: examples/postman_echo/request_methods/hardcode.yml
|
||||||
from httprunner import HttpRunner, TConfig, TStep
|
from httprunner import HttpRunner, TConfig, TStep
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# NOTICE: Generated By HttpRunner. DO'NOT EDIT!
|
# NOTICE: Generated By HttpRunner. DO'NOT EDIT!
|
||||||
|
# FROM: examples/postman_echo/request_methods/request_with_functions.yml
|
||||||
from httprunner import HttpRunner, TConfig, TStep
|
from httprunner import HttpRunner, TConfig, TStep
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# NOTICE: Generated By HttpRunner. DO'NOT EDIT!
|
# NOTICE: Generated By HttpRunner. DO'NOT EDIT!
|
||||||
|
# FROM: examples/postman_echo/request_methods/request_with_testcase_reference.yml
|
||||||
from httprunner import HttpRunner, TConfig, TStep
|
from httprunner import HttpRunner, TConfig, TStep
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# NOTICE: Generated By HttpRunner. DO'NOT EDIT!
|
# NOTICE: Generated By HttpRunner. DO'NOT EDIT!
|
||||||
|
# FROM: examples/postman_echo/request_methods/request_with_variables.yml
|
||||||
from httprunner import HttpRunner, TConfig, TStep
|
from httprunner import HttpRunner, TConfig, TStep
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# NOTICE: Generated By HttpRunner. DO'NOT EDIT!
|
# NOTICE: Generated By HttpRunner. DO'NOT EDIT!
|
||||||
|
# FROM: examples/postman_echo/request_methods/validate_with_functions.yml
|
||||||
from httprunner import HttpRunner, TConfig, TStep
|
from httprunner import HttpRunner, TConfig, TStep
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# NOTICE: Generated By HttpRunner. DO'NOT EDIT!
|
# NOTICE: Generated By HttpRunner. DO'NOT EDIT!
|
||||||
|
# FROM: examples/postman_echo/request_methods/validate_with_variables.yml
|
||||||
from httprunner import HttpRunner, TConfig, TStep
|
from httprunner import HttpRunner, TConfig, TStep
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ from httprunner.exceptions import TestCaseFormatError
|
|||||||
from httprunner.loader import load_testcase_file, load_folder_files
|
from httprunner.loader import load_testcase_file, load_folder_files
|
||||||
|
|
||||||
__TMPL__ = """# NOTICE: Generated By HttpRunner. DO'NOT EDIT!
|
__TMPL__ = """# NOTICE: Generated By HttpRunner. DO'NOT EDIT!
|
||||||
|
# FROM: {{ testcase_path }}
|
||||||
from httprunner import HttpRunner, TConfig, TStep
|
from httprunner import HttpRunner, TConfig, TStep
|
||||||
|
|
||||||
|
|
||||||
@@ -64,6 +65,7 @@ def make_testcase(testcase_path: str) -> Union[str, None]:
|
|||||||
config = testcase["config"]
|
config = testcase["config"]
|
||||||
config["path"] = testcase_python_path
|
config["path"] = testcase_python_path
|
||||||
data = {
|
data = {
|
||||||
|
"testcase_path": testcase_path,
|
||||||
"class_name": f"TestCase{name_in_title_case}",
|
"class_name": f"TestCase{name_in_title_case}",
|
||||||
"config": config,
|
"config": config,
|
||||||
"teststeps": testcase["teststeps"],
|
"teststeps": testcase["teststeps"],
|
||||||
@@ -120,7 +122,7 @@ def init_make_parser(subparsers):
|
|||||||
""" make testcases: parse command line options and run commands.
|
""" make testcases: parse command line options and run commands.
|
||||||
"""
|
"""
|
||||||
parser = subparsers.add_parser(
|
parser = subparsers.add_parser(
|
||||||
"make", help="Convert YAML/JSON testcases to Python unittests.",
|
"make", help="Convert YAML/JSON testcases to pytest cases.",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"testcase_path", nargs="*", help="Specify YAML/JSON testcase file/folder path"
|
"testcase_path", nargs="*", help="Specify YAML/JSON testcase file/folder path"
|
||||||
|
|||||||
Reference in New Issue
Block a user