mirror of
https://github.com/httprunner/httprunner.git
synced 2026-08-28 03:30:01 +08:00
can only use parameter names (sep, maxsplit) in Python 3.x, not supported in Python2.x
This commit is contained in:
+3
-1
@@ -69,7 +69,9 @@ def extract_response(resp_obj, context, delimiter='.'):
|
|||||||
try:
|
try:
|
||||||
if isinstance(value, str):
|
if isinstance(value, str):
|
||||||
value += "."
|
value += "."
|
||||||
top_query, sub_query = value.split(delimiter, maxsplit=1)
|
# string.split(sep=None, maxsplit=-1) -> list of strings
|
||||||
|
# e.g. "content.person.name" => ["content", "person.name"]
|
||||||
|
top_query, sub_query = value.split(delimiter, 1)
|
||||||
|
|
||||||
if top_query in ["body", "content", "text"]:
|
if top_query in ["body", "content", "text"]:
|
||||||
json_content = parse_response_body(resp_obj)
|
json_content = parse_response_body(resp_obj)
|
||||||
|
|||||||
Reference in New Issue
Block a user