mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-07 00:17:37 +08:00
fix: variable in current url maybe extracted from former api
This commit is contained in:
+27
-9
@@ -806,15 +806,33 @@ def __parse_tests(tests, config, project_mapping):
|
|||||||
test_dict["variables"],
|
test_dict["variables"],
|
||||||
functions
|
functions
|
||||||
)
|
)
|
||||||
request_url = parse_data(
|
try:
|
||||||
test_dict["request"]["url"],
|
request_url = parse_data(
|
||||||
test_dict["variables"],
|
test_dict["request"]["url"],
|
||||||
functions
|
test_dict["variables"],
|
||||||
)
|
functions
|
||||||
test_dict["request"]["url"] = utils.build_url(
|
)
|
||||||
base_url,
|
test_dict["request"]["url"] = utils.build_url(
|
||||||
request_url
|
base_url,
|
||||||
)
|
request_url
|
||||||
|
)
|
||||||
|
except exceptions.VariableNotFound:
|
||||||
|
""" variable in current url maybe extracted from former api
|
||||||
|
"tests": [
|
||||||
|
{
|
||||||
|
"request": {},
|
||||||
|
"extract": {
|
||||||
|
"host1": content.host1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"request": {
|
||||||
|
"url": "$host1/path1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def _parse_testcase(testcase, project_mapping):
|
def _parse_testcase(testcase, project_mapping):
|
||||||
|
|||||||
Reference in New Issue
Block a user