mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-06 16:07:45 +08:00
Merge branch 'master' of https://github.com/httprunner/HttpRunner
This commit is contained in:
@@ -40,6 +40,7 @@ def gen_locustfile(testcase_file_path):
|
|||||||
"templates",
|
"templates",
|
||||||
"locustfile_template"
|
"locustfile_template"
|
||||||
)
|
)
|
||||||
|
TestcaseLoader.load_test_dependencies()
|
||||||
testset = TestcaseLoader.load_test_file(testcase_file_path)
|
testset = TestcaseLoader.load_test_file(testcase_file_path)
|
||||||
host = testset.get("config", {}).get("request", {}).get("base_url", "")
|
host = testset.get("config", {}).get("request", {}).get("base_url", "")
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import re
|
|||||||
from httprunner import exception, logger, testcase, utils
|
from httprunner import exception, logger, testcase, utils
|
||||||
from httprunner.compat import OrderedDict, basestring
|
from httprunner.compat import OrderedDict, basestring
|
||||||
from requests.structures import CaseInsensitiveDict
|
from requests.structures import CaseInsensitiveDict
|
||||||
|
from requests.models import PreparedRequest
|
||||||
|
|
||||||
text_extractor_regexp_compile = re.compile(r".*\(.*\).*")
|
text_extractor_regexp_compile = re.compile(r".*\(.*\).*")
|
||||||
|
|
||||||
@@ -95,6 +96,10 @@ class ResponseObject(object):
|
|||||||
# TODO: remove compatibility for content, text
|
# TODO: remove compatibility for content, text
|
||||||
if isinstance(top_query_content, bytes):
|
if isinstance(top_query_content, bytes):
|
||||||
top_query_content = top_query_content.decode("utf-8")
|
top_query_content = top_query_content.decode("utf-8")
|
||||||
|
|
||||||
|
if isinstance(top_query_content, PreparedRequest):
|
||||||
|
top_query_content = top_query_content.__dict__
|
||||||
|
else:
|
||||||
top_query_content = json.loads(top_query_content)
|
top_query_content = json.loads(top_query_content)
|
||||||
except json.decoder.JSONDecodeError:
|
except json.decoder.JSONDecodeError:
|
||||||
err_msg = u"Failed to extract data with delimiter!\n"
|
err_msg = u"Failed to extract data with delimiter!\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user